refactor🎨 :支持名称和编码模糊搜索

This commit is contained in:
wenjianzhang committed 2021-06-07 18:05:05 +08:00
1 parent 65e0b58be9
commit c96d9c35a7
1 file changed
+7 -7
+7 -7
View File
@@ -10,12 +10,12 @@ import (
// SysPostSearch 列表或者搜索使用结构体
type SysPostSearch struct {
dto.Pagination `search:"-"`
PostId int `form:"postId" search:"type:exact;column:post_id;table:sys_post" comment:"id"` // id
PostName string `form:"postName" search:"type:exact;column:post_name;table:sys_post" comment:"名称"` // 名称
PostCode string `form:"postCode" search:"type:exact;column:post_code;table:sys_post" comment:"编码"` // 编码
Sort int `form:"sort" search:"type:exact;column:sort;table:sys_post" comment:"排序"` // 排序
Status int `form:"status" search:"type:exact;column:status;table:sys_post" comment:"状态"` // 状态
Remark string `form:"remark" search:"type:exact;column:remark;table:sys_post" comment:"备注"` // 备注
PostId int `form:"postId" search:"type:exact;column:post_id;table:sys_post" comment:"id"` // id
PostName string `form:"postName" search:"type:contains;column:post_name;table:sys_post" comment:"名称"` // 名称
PostCode string `form:"postCode" search:"type:contains;column:post_code;table:sys_post" comment:"编码"` // 编码
Sort int `form:"sort" search:"type:exact;column:sort;table:sys_post" comment:"排序"` // 排序
Status int `form:"status" search:"type:exact;column:status;table:sys_post" comment:"状态"` // 状态
Remark string `form:"remark" search:"type:exact;column:remark;table:sys_post" comment:"备注"` // 备注
}
func (m *SysPostSearch) GetNeedSearch() interface{} {
@@ -82,4 +82,4 @@ func (s *SysPostById) GetId() interface{} {
func (s *SysPostById) GenerateM() (*models.SysPost, error) {
return &models.SysPost{}, nil
}
}