package dto import ( "go-admin/app/admin/models" "go-admin/common/dto" common "go-admin/common/models" ) type OtAppsGetPageReq struct { dto.Pagination `search:"-"` Name string `form:"name" search:"type:contains;column:name;table:ot_apps" comment:"业务名"` Alias string `form:"alias" search:"type:contains;column:alias;table:ot_apps" comment:"业务别名"` ContractInfo string `form:"contractInfo" search:"type:exact;column:contract_info;table:ot_apps" comment:"管理信息"` ContractPhone string `form:"contractPhone" search:"type:exact;column:contract_phone;table:ot_apps" comment:"管理员手机号"` OtAppsOrder } type OtAppsOrder struct { Id string `form:"idOrder" search:"type:order;column:id;table:ot_apps"` CreatedAt string `form:"createdAtOrder" search:"type:order;column:created_at;table:ot_apps"` UpdatedAt string `form:"updatedAtOrder" search:"type:order;column:updated_at;table:ot_apps"` DeletedAt string `form:"deletedAtOrder" search:"type:order;column:deleted_at;table:ot_apps"` CreateBy string `form:"createByOrder" search:"type:order;column:create_by;table:ot_apps"` UpdateBy string `form:"updateByOrder" search:"type:order;column:update_by;table:ot_apps"` Name string `form:"nameOrder" search:"type:order;column:name;table:ot_apps"` Alias string `form:"aliasOrder" search:"type:order;column:alias;table:ot_apps"` Desc string `form:"descOrder" search:"type:order;column:desc;table:ot_apps"` ImgUrl string `form:"imgUrlOrder" search:"type:order;column:img_url;table:ot_apps"` ContractInfo string `form:"contractInfoOrder" search:"type:order;column:contract_info;table:ot_apps"` ContractPhone string `form:"contractPhoneOrder" search:"type:order;column:contract_phone;table:ot_apps"` } func (m *OtAppsGetPageReq) GetNeedSearch() interface{} { return *m } type OtAppsInsertReq struct { Id int `json:"-" comment:""` Name string `json:"name" comment:"业务名"` Alias string `json:"alias" comment:"业务别名"` Desc string `json:"desc" comment:"业务描述"` ImgUrl string `json:"imgUrl" comment:"业务图片"` ContractInfo string `json:"contractInfo" comment:"管理信息"` ContractPhone string `json:"contractPhone" comment:"管理员手机号"` ServiceNames []string `json:"serviceNames" comment:"关联的服务名称"` common.ControlBy } func (s *OtAppsInsertReq) Generate(model *models.OtApps) { if s.Id == 0 { model.Model = common.Model{Id: s.Id} } model.CreateBy = s.CreateBy // 添加这而,需要记录是被谁创建的 model.Name = s.Name model.Alias = s.Alias model.Desc = s.Desc model.ImgUrl = s.ImgUrl model.ContractInfo = s.ContractInfo model.ContractPhone = s.ContractPhone } func (s *OtAppsInsertReq) GetId() interface{} { return s.Id } type OtAppsUpdateReq struct { Id int `uri:"id" comment:""` // Name string `json:"name" comment:"业务名"` Alias string `json:"alias" comment:"业务别名"` Desc string `json:"desc" comment:"业务描述"` ImgUrl string `json:"imgUrl" comment:"业务图片"` ContractInfo string `json:"contractInfo" comment:"管理信息"` ContractPhone string `json:"contractPhone" comment:"管理员手机号"` ServiceNames []string `json:"serviceNames" comment:"AppAlias关联的服务名称"` common.ControlBy } func (s *OtAppsUpdateReq) Generate(model *models.OtApps) { if s.Id == 0 { model.Model = common.Model{Id: s.Id} } model.UpdateBy = s.UpdateBy // 添加这而,需要记录是被谁更新的 model.Name = s.Name model.Alias = s.Alias model.Desc = s.Desc model.ImgUrl = s.ImgUrl model.ContractInfo = s.ContractInfo model.ContractPhone = s.ContractPhone } func (s *OtAppsUpdateReq) GetId() interface{} { return s.Id } // OtAppsGetReq 功能获取请求参数 type OtAppsGetReq struct { Id int `uri:"id"` } func (s *OtAppsGetReq) GetId() interface{} { return s.Id } // OtAppsDeleteReq 功能删除请求参数 type OtAppsDeleteReq struct { Ids []int `json:"ids"` } func (s *OtAppsDeleteReq) GetId() interface{} { return s.Ids }