增加了 配置管理功能

This commit is contained in:
pixel
2020-01-15 13:50:24 +08:00
parent 8257d0a680
commit 3bf479d3d9
8 changed files with 123 additions and 46 deletions

View File

@@ -39,3 +39,21 @@ func SetSystemConfig(c *gin.Context) {
servers.ReportFormat(c, true, "设置成功", gin.H{})
}
}
// @Tags system
// @Summary 设置配置文件内容
// @Security ApiKeyAuth
// @Produce application/json
// @Param data body sysModel.System true
// @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}"
// @Router /system/ReloadSystem [post]
func ReloadSystem(c *gin.Context) {
var sys sysModel.System
_ = c.ShouldBind(&sys)
err := sys.SetSystemConfig()
if err != nil {
servers.ReportFormat(c, false, fmt.Sprintf("设置失败:%v", err), gin.H{})
} else {
servers.ReportFormat(c, true, "设置成功", gin.H{})
}
}