集成完成

This commit is contained in:
feilong.teng@rheinchina.com
2021-12-12 19:49:39 +08:00
commit cd824b7f0c
462 changed files with 33688 additions and 0 deletions

31
system/api/settings.go Normal file
View File

@@ -0,0 +1,31 @@
package api
import (
"pandax/base/biz"
"pandax/base/ctx"
"pandax/base/ginx"
"pandax/system/entity"
"pandax/system/services"
)
type SettingApi struct {
SettingApp services.SysSettingsModel
}
// 获取信息
func (s *SettingApi) GetSettingsInfo(rc *ctx.ReqCtx) {
key := rc.GinCtx.Query("key")
biz.IsTrue(key != "", "请传入字典类型")
rc.ResData = s.SettingApp.FindOne(key)
}
func (s *SettingApi) SetSettingsInfo(rc *ctx.ReqCtx) {
var set entity.SysSettings
ginx.BindJsonAndValid(rc.GinCtx, &set)
one := s.SettingApp.FindOne(set.Key)
if one.Id != 0 {
s.SettingApp.Update(set)
} else {
s.SettingApp.Insert(set)
}
}