mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 02:04:09 +00:00
feat✨ :参数配置中添加是否前台控制
This commit is contained in:
@@ -56,12 +56,16 @@ func (e *SysConfig) GetSysConfigBySysApp(c *gin.Context) {
|
||||
log.Error(err)
|
||||
return
|
||||
}
|
||||
d.ConfigKey = "sys_app_"
|
||||
err = d.Bind(c)
|
||||
if err != nil {
|
||||
log.Errorf("参数验证失败, error:%s", err)
|
||||
e.Error(c, 500, err, "参数验证失败")
|
||||
return
|
||||
}
|
||||
|
||||
// 控制只读前台的数据
|
||||
d.IsFrontend = 1
|
||||
|
||||
|
||||
list := make([]system.SysConfig, 0)
|
||||
s := service.SysConfig{}
|
||||
@@ -73,7 +77,7 @@ func (e *SysConfig) GetSysConfigBySysApp(c *gin.Context) {
|
||||
e.Error(c, 500, err, "查询失败")
|
||||
return
|
||||
}
|
||||
mp :=make(map[string]string)
|
||||
mp := make(map[string]string)
|
||||
for i := 0; i < len(list); i++ {
|
||||
key := list[i].ConfigKey
|
||||
if key != "" {
|
||||
|
||||
@@ -9,8 +9,9 @@ type SysConfig struct {
|
||||
ConfigName string `json:"configName" gorm:"type:varchar(128);comment:ConfigName"` //
|
||||
ConfigKey string `json:"configKey" gorm:"type:varchar(128);comment:ConfigKey"` //
|
||||
ConfigValue string `json:"configValue" gorm:"type:varchar(255);comment:ConfigValue"` //
|
||||
ConfigType string `json:"configType" gorm:"type:varchar(64);comment:ConfigType"` //
|
||||
Remark string `json:"remark" gorm:"type:varchar(128);comment:Remark"` //
|
||||
ConfigType string `json:"configType" gorm:"type:varchar(64);comment:ConfigType"`
|
||||
IsFrontend int `json:"isFrontend" gorm:"type:varchar(64);comment:是否前台"` //
|
||||
Remark string `json:"remark" gorm:"type:varchar(128);comment:Remark"` //
|
||||
models.ControlBy
|
||||
models.ModelTime
|
||||
}
|
||||
@@ -26,4 +27,4 @@ func (e *SysConfig) Generate() models.ActiveRecord {
|
||||
|
||||
func (e *SysConfig) GetId() interface{} {
|
||||
return e.Id
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@ type SysConfigSearch struct {
|
||||
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:""`
|
||||
IsFrontend int `json:"isFrontend" search:"type:exact;column:is_frontend;table:sys_config" comment:""`
|
||||
}
|
||||
|
||||
func (m *SysConfigSearch) GetNeedSearch() interface{} {
|
||||
@@ -41,6 +42,7 @@ type SysConfigControl struct {
|
||||
ConfigKey string `uri:"configKey" json:"configKey" comment:""`
|
||||
ConfigValue string `json:"configValue" comment:""`
|
||||
ConfigType string `json:"configType" comment:""`
|
||||
IsFrontend int `json:"isFrontend"`
|
||||
Remark string `json:"remark" comment:""`
|
||||
}
|
||||
|
||||
@@ -73,6 +75,7 @@ func (s *SysConfigControl) Generate() (*system.SysConfig, error) {
|
||||
ConfigKey: s.ConfigKey,
|
||||
ConfigValue: s.ConfigValue,
|
||||
ConfigType: s.ConfigType,
|
||||
IsFrontend: s.IsFrontend,
|
||||
Remark: s.Remark,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user