Sfoglia il codice sorgente

Merge branch 'master' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev

pixel 3 anni fa
parent
commit
46da9d0dd4

+ 2 - 2
server/config/captcha.go

@@ -2,6 +2,6 @@ package config
 
 type Captcha struct {
 	KeyLong   int `mapstructure:"key-long" json:"keyLong" yaml:"key-long"`       // 验证码长度
-	ImgWidth  int `mapstructure:"img-width" json:"imgWidth" yaml:"img-width"`    // 图片宽度
-	ImgHeight int `mapstructure:"img-height" json:"imgHeight" yaml:"img-height"` // 图片高度
+	ImgWidth  int `mapstructure:"img-width" json:"imgWidth" yaml:"img-width"`    // 验证码宽度
+	ImgHeight int `mapstructure:"img-height" json:"imgHeight" yaml:"img-height"` // 验证码高度
 }

+ 1 - 1
server/config/casbin.go

@@ -1,5 +1,5 @@
 package config
 
 type Casbin struct {
-	ModelPath string `mapstructure:"model-path" json:"modelPath" yaml:"model-path"` // Model路径
+	ModelPath string `mapstructure:"model-path" json:"modelPath" yaml:"model-path"` // 存放casbin模型的相对路径
 }

+ 1 - 1
server/config/email.go

@@ -1,7 +1,7 @@
 package config
 
 type Email struct {
-	To       string `mapstructure:"to" json:"to" yaml:"to"`                   // 收件人
+	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"`             // 服务器地址

+ 8 - 8
server/config/gorm.go

@@ -1,14 +1,14 @@
 package config
 
 type Mysql struct {
-	Path         string `mapstructure:"path" json:"path" yaml:"path"` // 服务器地址:端口
-	Config       string `mapstructure:"config" json:"config" yaml:"config"`
-	Dbname       string `mapstructure:"db-name" json:"dbname" yaml:"db-name"`     // 数据库名
-	Username     string `mapstructure:"username" json:"username" yaml:"username"` // 数据库用户名
-	Password     string `mapstructure:"password" json:"password" yaml:"password"` // 数据库密码
-	MaxIdleConns int    `mapstructure:"max-idle-conns" json:"maxIdleConns" yaml:"max-idle-conns"`
-	MaxOpenConns int    `mapstructure:"max-open-conns" json:"maxOpenConns" yaml:"max-open-conns"`
-	LogMode      bool   `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"`
+	Path         string `mapstructure:"path" json:"path" yaml:"path"`                             // 服务器地址:端口
+	Config       string `mapstructure:"config" json:"config" yaml:"config"`                       // 高级配置
+	Dbname       string `mapstructure:"db-name" json:"dbname" yaml:"db-name"`                     // 数据库名
+	Username     string `mapstructure:"username" json:"username" yaml:"username"`                 // 数据库用户名
+	Password     string `mapstructure:"password" json:"password" yaml:"password"`                 // 数据库密码
+	MaxIdleConns int    `mapstructure:"max-idle-conns" json:"maxIdleConns" yaml:"max-idle-conns"` // 空闲中的最大连接数
+	MaxOpenConns int    `mapstructure:"max-open-conns" json:"maxOpenConns" yaml:"max-open-conns"` // 打开到数据库的最大连接数
+	LogMode      bool   `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"`                  // 是否开启Gorm全局日志
 	LogZap       string `mapstructure:"log-zap" json:"logZap" yaml:"log-zap"`
 }
 

+ 2 - 2
server/config/oss.go

@@ -9,8 +9,8 @@ type Qiniu struct {
 	Bucket        string `mapstructure:"bucket" json:"bucket" yaml:"bucket"`                          // 空间名称
 	ImgPath       string `mapstructure:"img-path" json:"imgPath" yaml:"img-path"`                     // CDN加速域名
 	UseHTTPS      bool   `mapstructure:"use-https" json:"useHttps" yaml:"use-https"`                  // 是否使用https
-	AccessKey     string `mapstructure:"access-key" json:"accessKey" yaml:"access-key"`               // accessKey
-	SecretKey     string `mapstructure:"secret-key" json:"secretKey" yaml:"secret-key"`               // secretKey
+	AccessKey     string `mapstructure:"access-key" json:"accessKey" yaml:"access-key"`               // 秘钥AK
+	SecretKey     string `mapstructure:"secret-key" json:"secretKey" yaml:"secret-key"`               // 秘钥SK
 	UseCdnDomains bool   `mapstructure:"use-cdn-domains" json:"useCdnDomains" yaml:"use-cdn-domains"` // 上传是否使用CDN上传加速
 }
 

+ 1 - 1
server/config/redis.go

@@ -1,7 +1,7 @@
 package config
 
 type Redis struct {
-	DB       int    `mapstructure:"db" json:"db" yaml:"db"`
+	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"` // 密码
 }

+ 5 - 5
server/config/timer.go

@@ -1,13 +1,13 @@
 package config
 
 type Timer struct {
-	Start  bool     `mapstructure:"start" json:"start" yaml:"start"`
-	Spec   string   `mapstructure:"spec" json:"spec" yaml:"spec"`
+	Start  bool     `mapstructure:"start" json:"start" yaml:"start"` // 是否启用
+	Spec   string   `mapstructure:"spec" json:"spec" yaml:"spec"`    // CRON表达式
 	Detail []Detail `mapstructure:"detail" json:"detail" yaml:"detail"`
 }
 
 type Detail struct {
-	TableName    string `mapstructure:"tableName" json:"tableName" yaml:"tableName"`
-	CompareField string `mapstructure:"compareField" json:"compareField" yaml:"compareField"`
-	Interval     string `mapstructure:"interval" json:"interval" yaml:"interval"`
+	TableName    string `mapstructure:"tableName" json:"tableName" yaml:"tableName"`          // 需要清理的表名
+	CompareField string `mapstructure:"compareField" json:"compareField" yaml:"compareField"` // 需要比较时间的字段
+	Interval     string `mapstructure:"interval" json:"interval" yaml:"interval"`             // 时间间隔
 }

+ 17 - 7
server/docs/docs.go

@@ -1,6 +1,6 @@
 // GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
 // This file was generated by swaggo/swag at
-// 2021-05-11 17:25:23.4731221 +0800 CST m=+1.258292701
+// 2021-05-14 11:28:23.4731221 +0800 CST m=+1.258292701
 
 package docs
 
@@ -2829,11 +2829,11 @@ var doc = `{
             "type": "object",
             "properties": {
                 "imgHeight": {
-                    "description": "图片高度",
+                    "description": "验证码高度",
                     "type": "integer"
                 },
                 "imgWidth": {
-                    "description": "图片宽度",
+                    "description": "验证码宽度",
                     "type": "integer"
                 },
                 "keyLong": {
@@ -2846,7 +2846,7 @@ var doc = `{
             "type": "object",
             "properties": {
                 "modelPath": {
-                    "description": "Model路径",
+                    "description": "存放casbin模型的相对路径",
                     "type": "string"
                 }
             }
@@ -2855,12 +2855,15 @@ var doc = `{
             "type": "object",
             "properties": {
                 "compareField": {
+                    "description": "需要比较时间的字段",
                     "type": "string"
                 },
                 "interval": {
+                    "description": "时间间隔",
                     "type": "string"
                 },
                 "tableName": {
+                    "description": "需要清理的表名",
                     "type": "string"
                 }
             }
@@ -2893,7 +2896,7 @@ var doc = `{
                     "type": "string"
                 },
                 "to": {
-                    "description": "收件人",
+                    "description": "收件人:多个以英文逗号分隔",
                     "type": "string"
                 }
             }
@@ -2936,6 +2939,7 @@ var doc = `{
             "type": "object",
             "properties": {
                 "config": {
+                    "description": "高级配置",
                     "type": "string"
                 },
                 "dbname": {
@@ -2943,15 +2947,18 @@ var doc = `{
                     "type": "string"
                 },
                 "logMode": {
+                    "description": "是否开启Gorm全局日志",
                     "type": "boolean"
                 },
                 "logZap": {
                     "type": "string"
                 },
                 "maxIdleConns": {
+                    "description": "空闲中的最大连接数",
                     "type": "integer"
                 },
                 "maxOpenConns": {
+                    "description": "打开到数据库的最大连接数",
                     "type": "integer"
                 },
                 "password": {
@@ -2972,7 +2979,7 @@ var doc = `{
             "type": "object",
             "properties": {
                 "accessKey": {
-                    "description": "accessKey",
+                    "description": "秘钥AK",
                     "type": "string"
                 },
                 "bucket": {
@@ -2984,7 +2991,7 @@ var doc = `{
                     "type": "string"
                 },
                 "secretKey": {
-                    "description": "secretKey",
+                    "description": "秘钥SK",
                     "type": "string"
                 },
                 "useCdnDomains": {
@@ -3009,6 +3016,7 @@ var doc = `{
                     "type": "string"
                 },
                 "db": {
+                    "description": "redis的哪个数据库",
                     "type": "integer"
                 },
                 "password": {
@@ -3128,9 +3136,11 @@ var doc = `{
                     }
                 },
                 "spec": {
+                    "description": "CRON表达式",
                     "type": "string"
                 },
                 "start": {
+                    "description": "是否启用",
                     "type": "boolean"
                 }
             }

+ 16 - 6
server/docs/swagger.json

@@ -2812,11 +2812,11 @@
             "type": "object",
             "properties": {
                 "imgHeight": {
-                    "description": "图片高度",
+                    "description": "验证码高度",
                     "type": "integer"
                 },
                 "imgWidth": {
-                    "description": "图片宽度",
+                    "description": "验证码宽度",
                     "type": "integer"
                 },
                 "keyLong": {
@@ -2829,7 +2829,7 @@
             "type": "object",
             "properties": {
                 "modelPath": {
-                    "description": "Model路径",
+                    "description": "存放casbin模型的相对路径",
                     "type": "string"
                 }
             }
@@ -2838,12 +2838,15 @@
             "type": "object",
             "properties": {
                 "compareField": {
+                    "description": "需要比较时间的字段",
                     "type": "string"
                 },
                 "interval": {
+                    "description": "时间间隔",
                     "type": "string"
                 },
                 "tableName": {
+                    "description": "需要清理的表名",
                     "type": "string"
                 }
             }
@@ -2876,7 +2879,7 @@
                     "type": "string"
                 },
                 "to": {
-                    "description": "收件人",
+                    "description": "收件人:多个以英文逗号分隔",
                     "type": "string"
                 }
             }
@@ -2919,6 +2922,7 @@
             "type": "object",
             "properties": {
                 "config": {
+                    "description": "高级配置",
                     "type": "string"
                 },
                 "dbname": {
@@ -2926,15 +2930,18 @@
                     "type": "string"
                 },
                 "logMode": {
+                    "description": "是否开启Gorm全局日志",
                     "type": "boolean"
                 },
                 "logZap": {
                     "type": "string"
                 },
                 "maxIdleConns": {
+                    "description": "空闲中的最大连接数",
                     "type": "integer"
                 },
                 "maxOpenConns": {
+                    "description": "打开到数据库的最大连接数",
                     "type": "integer"
                 },
                 "password": {
@@ -2955,7 +2962,7 @@
             "type": "object",
             "properties": {
                 "accessKey": {
-                    "description": "accessKey",
+                    "description": "秘钥AK",
                     "type": "string"
                 },
                 "bucket": {
@@ -2967,7 +2974,7 @@
                     "type": "string"
                 },
                 "secretKey": {
-                    "description": "secretKey",
+                    "description": "秘钥SK",
                     "type": "string"
                 },
                 "useCdnDomains": {
@@ -2992,6 +2999,7 @@
                     "type": "string"
                 },
                 "db": {
+                    "description": "redis的哪个数据库",
                     "type": "integer"
                 },
                 "password": {
@@ -3111,9 +3119,11 @@
                     }
                 },
                 "spec": {
+                    "description": "CRON表达式",
                     "type": "string"
                 },
                 "start": {
+                    "description": "是否启用",
                     "type": "boolean"
                 }
             }

+ 16 - 6
server/docs/swagger.yaml

@@ -45,10 +45,10 @@ definitions:
   config.Captcha:
     properties:
       imgHeight:
-        description: 图片高度
+        description: 验证码高度
         type: integer
       imgWidth:
-        description: 图片宽度
+        description: 验证码宽度
         type: integer
       keyLong:
         description: 验证码长度
@@ -57,16 +57,19 @@ definitions:
   config.Casbin:
     properties:
       modelPath:
-        description: Model路径
+        description: 存放casbin模型的相对路径
         type: string
     type: object
   config.Detail:
     properties:
       compareField:
+        description: 需要比较时间的字段
         type: string
       interval:
+        description: 时间间隔
         type: string
       tableName:
+        description: 需要清理的表名
         type: string
     type: object
   config.Email:
@@ -90,7 +93,7 @@ definitions:
         description: 密钥
         type: string
       to:
-        description: 收件人
+        description: 收件人:多个以英文逗号分隔
         type: string
     type: object
   config.Excel:
@@ -119,17 +122,21 @@ definitions:
   config.Mysql:
     properties:
       config:
+        description: 高级配置
         type: string
       dbname:
         description: 数据库名
         type: string
       logMode:
+        description: 是否开启Gorm全局日志
         type: boolean
       logZap:
         type: string
       maxIdleConns:
+        description: 空闲中的最大连接数
         type: integer
       maxOpenConns:
+        description: 打开到数据库的最大连接数
         type: integer
       password:
         description: 数据库密码
@@ -144,7 +151,7 @@ definitions:
   config.Qiniu:
     properties:
       accessKey:
-        description: accessKey
+        description: 秘钥AK
         type: string
       bucket:
         description: 空间名称
@@ -153,7 +160,7 @@ definitions:
         description: CDN加速域名
         type: string
       secretKey:
-        description: secretKey
+        description: 秘钥SK
         type: string
       useCdnDomains:
         description: 上传是否使用CDN上传加速
@@ -171,6 +178,7 @@ definitions:
         description: 服务器地址:端口
         type: string
       db:
+        description: redis的哪个数据库
         type: integer
       password:
         description: 密码
@@ -252,8 +260,10 @@ definitions:
           $ref: '#/definitions/config.Detail'
         type: array
       spec:
+        description: CRON表达式
         type: string
       start:
+        description: 是否启用
         type: boolean
     type: object
   config.Zap: