package dto import ( "cold-delivery/app/admin/model" "cold-delivery/common/dto" common "cold-delivery/common/model" "strings" ) type IceLockerGetPageReq struct { dto.Pagination `search:"-"` Name string `form:"name" search:"type:contains;column:name;table:ice_locker"` // 冷冻柜名称 Status string `form:"status" search:"type:exact;column:status;table:ice_locker"` // 状态 Sn string `form:"sn" search:"type:contains;column:sn;table:ice_locker"` // sn ShowTemp bool `form:"showTemp" search:"-"` // 展示最新温度 IceLockerOrder } type IceLockerOrder struct { CreatedAtOrder string `search:"type:order;column:created_at;table:ice_locker" form:"createdAtOrder" default:"desc"` IdOrder string `search:"type:order;column:id;table:ice_locker" form:"idOrder" default:"desc"` } type GetIceLockerReq struct { dto.Pagination `search:"-"` Status string `form:"status" search:"type:exact;column:status;table:ice_raft_record"` Locker int `form:"LockerId" search:"type:exact;column:ice_locker_id;table:ice_raft_record"` Code string `form:"code" search:"type:contains;column:code;table:ice_raft"` // 冰排名称 } func (m *GetIceLockerReq) GetNeedSearch() interface{} { return *m } func (m *IceLockerGetPageReq) GetNeedSearch() interface{} { return *m } type IceLockerInsertReq struct { Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码 Name string `json:"name" vd:"len($)>0;msg:'冷冻柜不能为空'"` // 冷冻柜名称 Sn string `json:"sn"` // sn Status string `json:"status"` // 1-停用 2-正常 common.ControlBy `swaggerignore:"true"` common.DeptBy `swaggerignore:"true"` } func (s *IceLockerInsertReq) Generate(model *model.IceLocker) { if s.Id != 0 { model.Id = s.Id } model.Name = s.Name model.Sn = strings.TrimSpace(s.Sn) model.Status = s.Status if s.ControlBy.UpdateBy != 0 { model.UpdateBy = s.UpdateBy } if s.ControlBy.CreateBy != 0 { model.CreateBy = s.CreateBy } if s.DeptBy.DeptId != 0 { model.DeptId = s.DeptId } } func (s *IceLockerInsertReq) GetId() interface{} { return s.Id } type IceLockerUpdateReq struct { Id int `json:"id" comment:"编码"` // 编码 Name string `json:"name" vd:"len($)>0;msg:'冷冻柜名称不能为空'"` // 冷冻柜名称 Sn string `json:"sn"` // sn Status string `json:"status"` // 1-停用 2-正常 common.ControlBy `swaggerignore:"true"` } func (s *IceLockerUpdateReq) Generate(model *model.IceLocker) { if s.Id != 0 { model.Id = s.Id } model.Name = s.Name model.Sn = strings.TrimSpace(s.Sn) model.Status = s.Status if s.ControlBy.UpdateBy != 0 { model.UpdateBy = s.UpdateBy } if s.ControlBy.CreateBy != 0 { model.CreateBy = s.CreateBy } } func (s *IceLockerUpdateReq) GetId() interface{} { return s.Id } type IceLockerGetReq struct { Id int `uri:"id"` } func (s *IceLockerGetReq) GetId() interface{} { return s.Id } type IceLockerDeleteReq struct { Id int `json:"id"` common.ControlBy `swaggerignore:"true"` } func (s *IceLockerDeleteReq) GetId() interface{} { return s.Id } type IceLockerBatchInsertReq struct { List []IceLockerInsertReq Status string `json:"status"` // 1-停用 2-正常 common.ControlBy `swaggerignore:"true"` common.DeptBy `swaggerignore:"true"` }