【修改】配置文件参数说明

This commit is contained in:
PandaGoAdmin
2022-01-20 08:02:42 +08:00
parent c8449e0432
commit c6ebe89865
3 changed files with 6 additions and 4 deletions

View File

@@ -36,6 +36,6 @@ type Tls struct {
}
type Rate struct {
IsRate bool `yaml:"is-rate"` // 是否限流
Enable bool `yaml:"enable"` // 是否限流
RateNum float64 `yaml:"rate-num"` // 限流数量
}

View File

@@ -7,10 +7,12 @@ server:
model: release
port: 7788
cors: true
# 接口限流
rate:
is-rate: true
enable: true
rate-num: 100
db-type: mysql
# 是否开启数据库表初始化
isInitTable: false
excel-dir: ./resource/excel/
tls:
@@ -40,7 +42,7 @@ redis:
port: 6379
mysql:
host: 47.104.252.2:3306
host: 127.0.0.1:3306
username: pandax
password: pandax
db-name: pandax

View File

@@ -52,7 +52,7 @@ func InitRouter() *gin.Engine {
router.Use(middleware.Cors())
}
// 流量限制
if serverConfig.Rate.IsRate {
if serverConfig.Rate.Enable {
router.Use(middleware.Rate())
}
// api接口