diff --git a/server/config/auto_code.go b/server/config/auto_code.go index 850aafde390ededa613380ca6bcec507786aeaa8..d39d7af8eb703bdd6372b6e94fc550e8a1f42220 100644 --- a/server/config/auto_code.go +++ b/server/config/auto_code.go @@ -1,18 +1,18 @@ package config type Autocode struct { - TransferRestart bool `mapstructure:"transfer-restart" json:"transfer-restart" yaml:"transfer-restart"` - Root string `mapstructure:"root" json:"root" yaml:"root"` + SModel string `mapstructure:"server-model" json:"server-model" yaml:"server-model"` + SRouter string `mapstructure:"server-router" json:"server-router" yaml:"server-router"` Server string `mapstructure:"server" json:"server" yaml:"server"` SApi string `mapstructure:"server-api" json:"server-api" yaml:"server-api"` SPlug string `mapstructure:"server-plug" json:"server-plug" yaml:"server-plug"` SInitialize string `mapstructure:"server-initialize" json:"server-initialize" yaml:"server-initialize"` - SModel string `mapstructure:"server-model" json:"server-model" yaml:"server-model"` - SRequest string `mapstructure:"server-request" json:"server-request" yaml:"server-request"` - SRouter string `mapstructure:"server-router" json:"server-router" yaml:"server-router"` - SService string `mapstructure:"server-service" json:"server-service" yaml:"server-service"` + Root string `mapstructure:"root" json:"root" yaml:"root"` + WTable string `mapstructure:"web-table" json:"web-table" yaml:"web-table"` Web string `mapstructure:"web" json:"web" yaml:"web"` + SService string `mapstructure:"server-service" json:"server-service" yaml:"server-service"` + SRequest string `mapstructure:"server-request" json:"server-request" yaml:"server-request"` WApi string `mapstructure:"web-api" json:"web-api" yaml:"web-api"` WForm string `mapstructure:"web-form" json:"web-form" yaml:"web-form"` - WTable string `mapstructure:"web-table" json:"web-table" yaml:"web-table"` + TransferRestart bool `mapstructure:"transfer-restart" json:"transfer-restart" yaml:"transfer-restart"` } diff --git a/server/config/db_list.go b/server/config/db_list.go index f77830e3af28ea3ecb679e2b0daadb980c49901a..17eaac9656bc468011d84861c07e16999ca9e741 100644 --- a/server/config/db_list.go +++ b/server/config/db_list.go @@ -9,24 +9,24 @@ type DsnProvider interface { // GeneralDB 也被 Pgsql 和 Mysql 原样使用 type GeneralDB struct { - Path string `mapstructure:"path" json:"path" yaml:"path"` // 服务器地址:端口 - Port string `mapstructure:"port" json:"port" yaml:"port"` //:端口 - Config string `mapstructure:"config" json:"config" yaml:"config"` // 高级配置 - Dbname string `mapstructure:"db-name" json:"db-name" yaml:"db-name"` // 数据库名 - Username string `mapstructure:"username" json:"username" yaml:"username"` // 数据库用户名 - Password string `mapstructure:"password" json:"password" yaml:"password"` // 数据库密码 - Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"` //全局表前缀,单独定义TableName则不生效 - Singular bool `mapstructure:"singular" json:"singular" yaml:"singular"` //是否开启全局禁用复数,true表示开启 + Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"` + Port string `mapstructure:"port" json:"port" yaml:"port"` + Config string `mapstructure:"config" json:"config" yaml:"config"` // 高级配置 + Dbname string `mapstructure:"db-name" json:"db-name" yaml:"db-name"` // 数据库名 + Username string `mapstructure:"username" json:"username" yaml:"username"` // 数据库密码 + Password string `mapstructure:"password" json:"password" yaml:"password"` // 数据库密码 + Path string `mapstructure:"path" json:"path" yaml:"path"` Engine string `mapstructure:"engine" json:"engine" yaml:"engine" default:"InnoDB"` //数据库引擎,默认InnoDB + LogMode string `mapstructure:"log-mode" json:"log-mode" yaml:"log-mode"` // 是否开启Gorm全局日志 MaxIdleConns int `mapstructure:"max-idle-conns" json:"max-idle-conns" yaml:"max-idle-conns"` // 空闲中的最大连接数 MaxOpenConns int `mapstructure:"max-open-conns" json:"max-open-conns" yaml:"max-open-conns"` // 打开到数据库的最大连接数 - LogMode string `mapstructure:"log-mode" json:"log-mode" yaml:"log-mode"` // 是否开启Gorm全局日志 + Singular bool `mapstructure:"singular" json:"singular" yaml:"singular"` //是否开启全局禁用复数,true表示开启 LogZap bool `mapstructure:"log-zap" json:"log-zap" yaml:"log-zap"` // 是否通过zap写入日志文件 } type SpecializedDB struct { - Disable bool `mapstructure:"disable" json:"disable" yaml:"disable"` Type string `mapstructure:"type" json:"type" yaml:"type"` AliasName string `mapstructure:"alias-name" json:"alias-name" yaml:"alias-name"` GeneralDB `yaml:",inline" mapstructure:",squash"` + Disable bool `mapstructure:"disable" json:"disable" yaml:"disable"` } diff --git a/server/config/email.go b/server/config/email.go index 6914593e6e66ffddbb8eb56bb0767c8b956a6c0b..0984616b249f8bc19b2bc67cd7477d00faa0399b 100644 --- a/server/config/email.go +++ b/server/config/email.go @@ -1,11 +1,11 @@ package config type Email struct { - To string `mapstructure:"to" json:"to" yaml:"to"` // 收件人:多个以英文逗号分隔 - Port int `mapstructure:"port" json:"port" yaml:"port"` // 端口 - From string `mapstructure:"from" json:"from" yaml:"from"` // 收件人 - Host string `mapstructure:"host" json:"host" yaml:"host"` // 服务器地址 - IsSSL bool `mapstructure:"is-ssl" json:"is-ssl" yaml:"is-ssl"` // 是否SSL - Secret string `mapstructure:"secret" json:"secret" yaml:"secret"` // 密钥 - Nickname string `mapstructure:"nickname" json:"nickname" yaml:"nickname"` // 昵称 + To string `mapstructure:"to" json:"to" yaml:"to"` // 收件人:多个以英文逗号分隔 例:a@qq.com b@qq.com 正式开发中请把此项目作为参数使用 + From string `mapstructure:"from" json:"from" yaml:"from"` // 发件人 你自己要发邮件的邮箱 + Host string `mapstructure:"host" json:"host" yaml:"host"` // 服务器地址 例如 smtp.qq.com 请前往QQ或者你要发邮件的邮箱查看其smtp协议 + Secret string `mapstructure:"secret" json:"secret" yaml:"secret"` // 密钥 用于登录的密钥 最好不要用邮箱密码 去邮箱smtp申请一个用于登录的密钥 + Nickname string `mapstructure:"nickname" json:"nickname" yaml:"nickname"` // 昵称 发件人昵称 通常为自己的邮箱 + Port int `mapstructure:"port" json:"port" yaml:"port"` // 端口 请前往QQ或者你要发邮件的邮箱查看其smtp协议 大多为 465 + IsSSL bool `mapstructure:"is-ssl" json:"is-ssl" yaml:"is-ssl"` // 是否SSL 是否开启SSL } diff --git a/server/config/oss_aws.go b/server/config/oss_aws.go index 0db2d91725b30e4f20d77b5b85acece67b8b401a..7ec6acc54b6366b15f5c0e6ed499e6f33531b8ec 100644 --- a/server/config/oss_aws.go +++ b/server/config/oss_aws.go @@ -4,10 +4,10 @@ type AwsS3 struct { Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"` Region string `mapstructure:"region" json:"region" yaml:"region"` Endpoint string `mapstructure:"endpoint" json:"endpoint" yaml:"endpoint"` - S3ForcePathStyle bool `mapstructure:"s3-force-path-style" json:"s3-force-path-style" yaml:"s3-force-path-style"` - DisableSSL bool `mapstructure:"disable-ssl" json:"disable-ssl" yaml:"disable-ssl"` SecretID string `mapstructure:"secret-id" json:"secret-id" yaml:"secret-id"` SecretKey string `mapstructure:"secret-key" json:"secret-key" yaml:"secret-key"` BaseURL string `mapstructure:"base-url" json:"base-url" yaml:"base-url"` PathPrefix string `mapstructure:"path-prefix" json:"path-prefix" yaml:"path-prefix"` + S3ForcePathStyle bool `mapstructure:"s3-force-path-style" json:"s3-force-path-style" yaml:"s3-force-path-style"` + DisableSSL bool `mapstructure:"disable-ssl" json:"disable-ssl" yaml:"disable-ssl"` } diff --git a/server/config/oss_qiniu.go b/server/config/oss_qiniu.go index 94ac91d8fcf69e76a920833c69b1dd7cdc35e7d0..298fe2d3c07866e7d8efd48acc22f9ae5ad34538 100644 --- a/server/config/oss_qiniu.go +++ b/server/config/oss_qiniu.go @@ -4,8 +4,8 @@ type Qiniu struct { Zone string `mapstructure:"zone" json:"zone" yaml:"zone"` // 存储区域 Bucket string `mapstructure:"bucket" json:"bucket" yaml:"bucket"` // 空间名称 ImgPath string `mapstructure:"img-path" json:"img-path" yaml:"img-path"` // CDN加速域名 - UseHTTPS bool `mapstructure:"use-https" json:"use-https" yaml:"use-https"` // 是否使用https AccessKey string `mapstructure:"access-key" json:"access-key" yaml:"access-key"` // 秘钥AK SecretKey string `mapstructure:"secret-key" json:"secret-key" yaml:"secret-key"` // 秘钥SK + UseHTTPS bool `mapstructure:"use-https" json:"use-https" yaml:"use-https"` // 是否使用https UseCdnDomains bool `mapstructure:"use-cdn-domains" json:"use-cdn-domains" yaml:"use-cdn-domains"` // 上传是否使用CDN上传加速 } diff --git a/server/config/redis.go b/server/config/redis.go index 1a25178f17a5ece89010a75f3b0bfe8c69c7c616..60dbb1ee30555998aacb5afdd74d8cc96caa2414 100644 --- a/server/config/redis.go +++ b/server/config/redis.go @@ -1,7 +1,7 @@ package config type Redis struct { - DB int `mapstructure:"db" json:"db" yaml:"db"` // redis的哪个数据库 Addr string `mapstructure:"addr" json:"addr" yaml:"addr"` // 服务器地址:端口 Password string `mapstructure:"password" json:"password" yaml:"password"` // 密码 + DB int `mapstructure:"db" json:"db" yaml:"db"` // redis的哪个数据库 } diff --git a/server/config/system.go b/server/config/system.go index 9d07c1011bcae4822ba40512ac784da3e2bdd135..bb1cfceb48ca9d7ce8943e1159f144e050f30364 100644 --- a/server/config/system.go +++ b/server/config/system.go @@ -1,13 +1,13 @@ package config type System struct { - Env string `mapstructure:"env" json:"env" yaml:"env"` // 环境值 - Addr int `mapstructure:"addr" json:"addr" yaml:"addr"` // 端口值 - DbType string `mapstructure:"db-type" json:"db-type" yaml:"db-type"` // 数据库类型:mysql(默认)|sqlite|sqlserver|postgresql - OssType string `mapstructure:"oss-type" json:"oss-type" yaml:"oss-type"` // Oss类型 - UseMultipoint bool `mapstructure:"use-multipoint" json:"use-multipoint" yaml:"use-multipoint"` // 多点登录拦截 - UseRedis bool `mapstructure:"use-redis" json:"use-redis" yaml:"use-redis"` // 使用redis + Env string `mapstructure:"env" json:"env" yaml:"env"` // 环境值 + DbType string `mapstructure:"db-type" json:"db-type" yaml:"db-type"` // 数据库类型:mysql(默认)|sqlite|sqlserver|postgresql + OssType string `mapstructure:"oss-type" json:"oss-type" yaml:"oss-type"` // Oss类型 + RouterPrefix string `mapstructure:"router-prefix" json:"router-prefix" yaml:"router-prefix"` + Addr int `mapstructure:"addr" json:"addr" yaml:"addr"` // 端口值 LimitCountIP int `mapstructure:"iplimit-count" json:"iplimit-count" yaml:"iplimit-count"` LimitTimeIP int `mapstructure:"iplimit-time" json:"iplimit-time" yaml:"iplimit-time"` - RouterPrefix string `mapstructure:"router-prefix" json:"router-prefix" yaml:"router-prefix"` + UseMultipoint bool `mapstructure:"use-multipoint" json:"use-multipoint" yaml:"use-multipoint"` // 多点登录拦截 + UseRedis bool `mapstructure:"use-redis" json:"use-redis" yaml:"use-redis"` // 使用redis } diff --git a/server/config/timer.go b/server/config/timer.go index f3f50705fa0c8a96eda3a223293b198c61918588..5057e50e69786d2f6d51372fa99f0d97e43a140c 100644 --- a/server/config/timer.go +++ b/server/config/timer.go @@ -1,10 +1,11 @@ package config type Timer struct { + Spec string `mapstructure:"spec" json:"spec" yaml:"spec"` // CRON表达式 + Detail []Detail `mapstructure:"detail" json:"detail" yaml:"detail"` Start bool `mapstructure:"start" json:"start" yaml:"start"` // 是否启用 - Spec string `mapstructure:"spec" json:"spec" yaml:"spec"` // CRON表达式 WithSeconds bool `mapstructure:"with_seconds" json:"with_seconds" yaml:"with_seconds"` // 是否精确到秒 - Detail []Detail `mapstructure:"detail" json:"detail" yaml:"detail"` + } type Detail struct {