package dto import ( "cold-delivery/app/admin/model" "cold-delivery/common/dto" common "cold-delivery/common/model" ) type IceRaftGetPageReq struct { dto.Pagination `search:"-"` Code string `form:"code" search:"type:contains;column:code;table:ice_raft"` // 冰排名称 Status string `form:"status" search:"type:exact;column:status;table:ice_raft"` // 状态 IceRaftOrder } type IceRaftGetNewestRecordPageReq struct { dto.Pagination `search:"-"` Code string `form:"code" search:"type:contains;column:code;table:ice_raft"` // 冰排名称 Status string `form:"status" search:"-"` // 状态 IceLockerId int `form:"iceLockerId" search:"-"` // 冷冻柜id CoolerBoxId int `form:"coolerBoxId" search:"-"` // 保温箱id IceRaftOrder } type GetPageByCoolerBoxIdReq struct { CoolerBoxId int `form:"coolerBoxId" search:"-"` // 保温箱id IceRaftOrder } type IceRaftOrder struct { CreatedAtOrder string `search:"type:order;column:created_at;table:ice_raft" form:"createdAtOrder" default:"desc"` IdOrder string `search:"type:order;column:id;table:ice_raft" form:"idOrder" default:"desc"` } func (m *IceRaftGetPageReq) GetNeedSearch() interface{} { return *m } func (m *IceRaftGetNewestRecordPageReq) GetNeedSearch() interface{} { return *m } type IceRaftInsertReq struct { Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码 CodeList []string `json:"codeList" vd:"len($)>0;msg:'冰排编号不能为空'"` // 冰排名称 Status string `json:"status"` // 1-停用 2-正常 FreezeClaim float32 `json:"freezeClaim"` // 冷冻要求 单位小时 common.ControlBy `swaggerignore:"true"` common.DeptBy `swaggerignore:"true"` } func (s *IceRaftInsertReq) Generate(model *model.IceRaft, code string) { if s.Id != 0 { model.Id = s.Id } model.Code = code model.Status = s.Status model.FreezeClaim = s.FreezeClaim 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 *IceRaftInsertReq) GetId() interface{} { return s.Id } type IceRaftUpdateReq struct { Id int `json:"id" comment:"编码"` // 编码 Code string `json:"code" vd:"len($)>0;msg:'冰排编号不能为空'"` // 冰排名称 Status string `json:"status"` // 1-停用 2-正常 FreezeClaim float32 `json:"freezeClaim"` // 冷冻要求 单位小时 common.ControlBy `swaggerignore:"true"` } func (s *IceRaftUpdateReq) Generate(model *model.IceRaft) { if s.Id != 0 { model.Id = s.Id } model.Code = s.Code model.Status = s.Status model.FreezeClaim = s.FreezeClaim if s.ControlBy.UpdateBy != 0 { model.UpdateBy = s.UpdateBy } if s.ControlBy.CreateBy != 0 { model.CreateBy = s.CreateBy } } func (s *IceRaftUpdateReq) GetId() interface{} { return s.Id } type IceRaftGetReq struct { Id int `uri:"id"` } func (s *IceRaftGetReq) GetId() interface{} { return s.Id } type IceRaftGetByCodeReq struct { Code string `uri:"code"` } type IceRaftDeleteReq struct { Id int `json:"id"` common.ControlBy `swaggerignore:"true"` } func (s *IceRaftDeleteReq) GetId() interface{} { return s.Id } type IceRaftInStorageReq struct { Code []string `json:"code"` IceLockerId int `json:"iceLockerId"` // 冷冻柜id FreezeClaim float32 `json:"freezeClaim"` // 冷冻要求 common.ControlBy `swaggerignore:"true"` } type IceRaftOutStorageReq struct { Code []string `json:"code"` CoolerBoxId int `json:"coolerBoxId"` // 保温箱id common.ControlBy `swaggerignore:"true"` } type IceRaftRecordGetPageReq struct { dto.Pagination `search:"-"` IceRaftId int `form:"iceRaftId" search:"type:exact;column:ice_raft_id;table:ice_raft_record" vd:"$>0;msg:'冰排id不能为空'"` // 冰排id Status string `form:"status" search:"type:exact;column:status;table:ice_raft_record"` // 状态 IceRaftRecordOrder } type IceRaftRecordOrder struct { CreatedAtOrder string `search:"type:order;column:created_at;table:ice_raft_record" form:"createdAtOrder" default:"desc"` } func (m *IceRaftRecordGetPageReq) GetNeedSearch() interface{} { return *m } type IceRaftRecordUpdateReq struct { Id int `json:"id" comment:"编码"` // 编码 IceLockerId int `json:"iceLockerId"` // 冷冻柜id CoolerBoxId int `json:"coolerBoxId"` // 保温箱id FreezeClaim float32 `json:"freezeClaim"` // 冷冻要求 单位小时 common.ControlBy `swaggerignore:"true"` } func (s *IceRaftRecordUpdateReq) GetId() interface{} { return s.Id } func (s *IceRaftRecordUpdateReq) Generate(model *model.IceRaftRecord) { if s.Id != 0 { model.Id = s.Id } model.IceLockerId = s.IceLockerId model.CoolerBoxId = s.CoolerBoxId model.FreezeClaim = s.FreezeClaim if s.ControlBy.UpdateBy != 0 { model.UpdateBy = s.UpdateBy } if s.ControlBy.CreateBy != 0 { model.CreateBy = s.CreateBy } } type IceRaftRecordDeleteReq struct { Id int `json:"id"` common.ControlBy `swaggerignore:"true"` } func (s *IceRaftRecordDeleteReq) GetId() interface{} { return s.Id }