kra-new/internal/service/dto/system_config.go

109 lines
4.1 KiB
Go

package dto
import "kra/internal/conf"
type SecurityConfigRequest struct {
ID uint `json:"ID"`
CaptchaOpen int `json:"captchaOpen"`
CaptchaTimeout int `json:"captchaTimeout"`
KeyLong int `json:"keyLong"`
ImgWidth int `json:"imgWidth"`
ImgHeight int `json:"imgHeight"`
PwdMinLength int `json:"pwdMinLength"`
PwdRequireUpper bool `json:"pwdRequireUpper"`
PwdRequireLower bool `json:"pwdRequireLower"`
PwdRequireDigit bool `json:"pwdRequireDigit"`
PwdRequireSpecial bool `json:"pwdRequireSpecial"`
LimitEnable bool `json:"limitEnable"`
LimitWindow int `json:"limitWindow"`
LimitCount int `json:"limitCount"`
LockEnable bool `json:"lockEnable"`
LockThreshold int `json:"lockThreshold"`
LockDuration int `json:"lockDuration"`
PwdExpireEnable bool `json:"pwdExpireEnable"`
PwdExpireDays int `json:"pwdExpireDays"`
ForceNewUserChangePassword bool `json:"forceNewUserChangePassword"`
}
type SetSystemConfigRequest struct {
Config struct {
Data *struct {
Database *struct {
Driver string `json:"driver"`
Source string `json:"source"`
Host string `json:"host"`
Port string `json:"port"`
User string `json:"user"`
Password string `json:"password"`
Name string `json:"name"`
Config string `json:"config"`
Path string `json:"path"`
Prefix string `json:"prefix"`
Engine string `json:"engine"`
LogMode string `json:"log_mode"`
MaxIdleConns int32 `json:"max_idle_conns"`
MaxOpenConns int32 `json:"max_open_conns"`
ConnMaxLifetime int32 `json:"conn_max_lifetime"`
Singular bool `json:"singular"`
} `json:"database"`
Redis *struct {
Network string `json:"network"`
Addr string `json:"addr"`
ReadTimeout string `json:"read_timeout"`
WriteTimeout string `json:"write_timeout"`
Name string `json:"name"`
Password string `json:"password"`
DB int32 `json:"db"`
UseCluster bool `json:"use_cluster"`
ClusterAddrs []string `json:"cluster_addrs"`
} `json:"redis"`
DatabaseList []*conf.Data_Database `json:"database_list"`
RedisList []*conf.Data_Redis `json:"redis_list"`
Mongo *conf.Data_Mongo `json:"mongo"`
} `json:"data"`
Admin struct {
RouterPrefix string `json:"routerPrefix"`
System struct {
UseRedis bool `json:"useRedis"`
UseMultipoint bool `json:"useMultipoint"`
UseStrictAuth bool `json:"useStrictAuth"`
DisableAutoMigrate bool `json:"disableAutoMigrate"`
UseMongo bool `json:"useMongo"`
} `json:"system"`
JWT struct {
SigningKey string `json:"signingKey"`
ExpiresTime string `json:"expiresTime"`
BufferTime string `json:"bufferTime"`
Issuer string `json:"issuer"`
} `json:"jwt"`
Captcha struct {
KeyLong int32 `json:"keyLong"`
ImgWidth int32 `json:"imgWidth"`
ImgHeight int32 `json:"imgHeight"`
StoreExpiration string `json:"storeExpiration"`
} `json:"captcha"`
Local struct {
StorePath string `json:"storePath"`
PathPrefix string `json:"pathPrefix"`
} `json:"local"`
Media struct {
SessionTTL int32 `json:"sessionTtl"`
} `json:"media"`
Storage *conf.AdminBackend_Storage `json:"storage"`
Zap *conf.AdminBackend_Zap `json:"zap"`
Cors *conf.AdminBackend_CORS `json:"cors"`
App *conf.AdminBackend_App `json:"app"`
} `json:"admin"`
Email *struct {
To string `json:"to"`
From string `json:"from"`
Host string `json:"host"`
Secret string `json:"secret"`
Nickname string `json:"nickname"`
Port int32 `json:"port"`
IsSSL bool `json:"is-ssl"`
IsLoginAuth bool `json:"is-loginauth"`
} `json:"email"`
} `json:"config"`
}