feat :系统配置统一使用参数设置功能

注意:系统配置表将设置为过时功能
This commit is contained in:
wenjianzhang
2021-03-17 10:18:47 +08:00
parent 55a85babf8
commit 51bc4423f7
4 changed files with 67 additions and 8 deletions
+3 -3
View File
@@ -15,8 +15,8 @@ import (
// SysConfigSearch 列表或者搜索使用结构体
type SysConfigSearch struct {
dto.Pagination `search:"-"`
ConfigName string `form:"configName" search:"type:exact;column:config_name;table:sys_config" comment:""`
ConfigKey string `form:"configKey" search:"type:exact;column:config_key;table:sys_config" comment:""`
ConfigName string `form:"configName" search:"type:contains;column:config_name;table:sys_config" comment:""`
ConfigKey string `form:"configKey" search:"type:contains;column:config_key;table:sys_config" comment:""`
ConfigType string `form:"configType" search:"type:exact;column:config_type;table:sys_config" comment:""`
}
@@ -113,4 +113,4 @@ func (s *SysConfigById) Bind(ctx *gin.Context) error {
func (s *SysConfigById) GenerateM() (*system.SysConfig, error) {
return &system.SysConfig{}, nil
}
}
+17 -1
View File
@@ -32,6 +32,22 @@ func (e *SysConfig) GetSysConfigPage(c *dto.SysConfigSearch, list *[]system.SysC
return nil
}
func (e *SysConfig) GetSysConfigByKey(c *dto.SysConfigSearch, list *[]system.SysConfig) error {
var err error
var data system.SysConfig
err = e.Orm.Model(&data).
Scopes(
cDto.MakeCondition(c.GetNeedSearch()),
).
Find(list).Error
if err != nil {
e.Log.Errorf("db error:%s", err)
return err
}
return nil
}
// GetSysConfig 获取SysConfig对象
func (e *SysConfig) GetSysConfig(d *dto.SysConfigById, model *system.SysConfig) error {
var err error
@@ -115,4 +131,4 @@ func (e *SysConfig) GetSysConfigByKEY(c *dto.SysConfigControl) error {
}
return nil
}
}