fix🐛 修复参数根据id获取功能

This commit is contained in:
zhangwenjian
2021-05-23 18:12:36 +08:00
parent c89b0ca8e1
commit 7491ff4459
+5 -2
View File
@@ -18,7 +18,7 @@ type SysConfigSearch struct {
ConfigName string `form:"configName" search:"type:contains;column:config_name;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:""` 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:""` 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:""` IsFrontend int `form:"isFrontend" search:"type:exact;column:is_frontend;table:sys_config" comment:""`
} }
func (m *SysConfigSearch) GetNeedSearch() interface{} { func (m *SysConfigSearch) GetNeedSearch() interface{} {
@@ -87,7 +87,6 @@ func (s *SysConfigControl) GetId() interface{} {
// SysConfigById 获取单个或者删除的结构体 // SysConfigById 获取单个或者删除的结构体
type SysConfigById struct { type SysConfigById struct {
Id int `uri:"id"`
Ids []int `json:"ids"` Ids []int `json:"ids"`
} }
@@ -97,7 +96,11 @@ func (s *SysConfigById) Generate() *SysConfigById {
} }
func (s *SysConfigById) GetId() interface{} { func (s *SysConfigById) GetId() interface{} {
if len(s.Ids) > 0 {
s.Ids = append(s.Ids, s.Id)
return s.Ids return s.Ids
}
return s.Id
} }
func (s *SysConfigById) Bind(ctx *gin.Context) error { func (s *SysConfigById) Bind(ctx *gin.Context) error {