ice_raft.go 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. package dto
  2. import (
  3. "cold-delivery/app/admin/model"
  4. "cold-delivery/common/dto"
  5. common "cold-delivery/common/model"
  6. )
  7. type IceRaftGetPageReq struct {
  8. dto.Pagination `search:"-"`
  9. Code string `form:"code" search:"type:contains;column:code;table:ice_raft"` // 冰排名称
  10. Status string `form:"status" search:"type:exact;column:status;table:ice_raft"` // 状态
  11. IceRaftOrder
  12. }
  13. type IceRaftGetNewestRecordPageReq struct {
  14. dto.Pagination `search:"-"`
  15. Code string `form:"code" search:"type:contains;column:code;table:ice_raft"` // 冰排名称
  16. Status string `form:"status" search:"-"` // 状态
  17. IceLockerId int `form:"iceLockerId" search:"-"` // 冷冻柜id
  18. CoolerBoxId int `form:"coolerBoxId" search:"-"` // 保温箱id
  19. IceRaftOrder
  20. }
  21. type GetPageByCoolerBoxIdReq struct {
  22. CoolerBoxId int `form:"coolerBoxId" search:"-"` // 保温箱id
  23. IceRaftOrder
  24. }
  25. type IceRaftOrder struct {
  26. CreatedAtOrder string `search:"type:order;column:created_at;table:ice_raft" form:"createdAtOrder" default:"desc"`
  27. IdOrder string `search:"type:order;column:id;table:ice_raft" form:"idOrder" default:"desc"`
  28. }
  29. func (m *IceRaftGetPageReq) GetNeedSearch() interface{} {
  30. return *m
  31. }
  32. func (m *IceRaftGetNewestRecordPageReq) GetNeedSearch() interface{} {
  33. return *m
  34. }
  35. type IceRaftInsertReq struct {
  36. Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码
  37. CodeList []string `json:"codeList" vd:"len($)>0;msg:'冰排编号不能为空'"` // 冰排名称
  38. Status string `json:"status"` // 1-停用 2-正常
  39. FreezeClaim float32 `json:"freezeClaim"` // 冷冻要求 单位小时
  40. common.ControlBy `swaggerignore:"true"`
  41. common.DeptBy `swaggerignore:"true"`
  42. }
  43. func (s *IceRaftInsertReq) Generate(model *model.IceRaft, code string) {
  44. if s.Id != 0 {
  45. model.Id = s.Id
  46. }
  47. model.Code = code
  48. model.Status = s.Status
  49. model.FreezeClaim = s.FreezeClaim
  50. if s.ControlBy.UpdateBy != 0 {
  51. model.UpdateBy = s.UpdateBy
  52. }
  53. if s.ControlBy.CreateBy != 0 {
  54. model.CreateBy = s.CreateBy
  55. }
  56. if s.DeptBy.DeptId != 0 {
  57. model.DeptId = s.DeptId
  58. }
  59. }
  60. func (s *IceRaftInsertReq) GetId() interface{} {
  61. return s.Id
  62. }
  63. type IceRaftUpdateReq struct {
  64. Id int `json:"id" comment:"编码"` // 编码
  65. Code string `json:"code" vd:"len($)>0;msg:'冰排编号不能为空'"` // 冰排名称
  66. Status string `json:"status"` // 1-停用 2-正常
  67. FreezeClaim float32 `json:"freezeClaim"` // 冷冻要求 单位小时
  68. common.ControlBy `swaggerignore:"true"`
  69. }
  70. func (s *IceRaftUpdateReq) Generate(model *model.IceRaft) {
  71. if s.Id != 0 {
  72. model.Id = s.Id
  73. }
  74. model.Code = s.Code
  75. model.Status = s.Status
  76. model.FreezeClaim = s.FreezeClaim
  77. if s.ControlBy.UpdateBy != 0 {
  78. model.UpdateBy = s.UpdateBy
  79. }
  80. if s.ControlBy.CreateBy != 0 {
  81. model.CreateBy = s.CreateBy
  82. }
  83. }
  84. func (s *IceRaftUpdateReq) GetId() interface{} {
  85. return s.Id
  86. }
  87. type IceRaftGetReq struct {
  88. Id int `uri:"id"`
  89. }
  90. func (s *IceRaftGetReq) GetId() interface{} {
  91. return s.Id
  92. }
  93. type IceRaftGetByCodeReq struct {
  94. Code string `uri:"code"`
  95. }
  96. type IceRaftDeleteReq struct {
  97. Id int `json:"id"`
  98. common.ControlBy `swaggerignore:"true"`
  99. }
  100. func (s *IceRaftDeleteReq) GetId() interface{} {
  101. return s.Id
  102. }
  103. type IceRaftInStorageReq struct {
  104. Code []string `json:"code"`
  105. IceLockerId int `json:"iceLockerId"` // 冷冻柜id
  106. FreezeClaim float32 `json:"freezeClaim"` // 冷冻要求
  107. common.ControlBy `swaggerignore:"true"`
  108. }
  109. type IceRaftOutStorageReq struct {
  110. Code []string `json:"code"`
  111. CoolerBoxId int `json:"coolerBoxId"` // 保温箱id
  112. common.ControlBy `swaggerignore:"true"`
  113. }
  114. type IceRaftRecordGetPageReq struct {
  115. dto.Pagination `search:"-"`
  116. IceRaftId int `form:"iceRaftId" search:"type:exact;column:ice_raft_id;table:ice_raft_record" vd:"$>0;msg:'冰排id不能为空'"` // 冰排id
  117. Status string `form:"status" search:"type:exact;column:status;table:ice_raft_record"` // 状态
  118. IceRaftRecordOrder
  119. }
  120. type IceRaftRecordOrder struct {
  121. CreatedAtOrder string `search:"type:order;column:created_at;table:ice_raft_record" form:"createdAtOrder" default:"desc"`
  122. }
  123. func (m *IceRaftRecordGetPageReq) GetNeedSearch() interface{} {
  124. return *m
  125. }
  126. type IceRaftRecordUpdateReq struct {
  127. Id int `json:"id" comment:"编码"` // 编码
  128. IceLockerId int `json:"iceLockerId"` // 冷冻柜id
  129. CoolerBoxId int `json:"coolerBoxId"` // 保温箱id
  130. FreezeClaim float32 `json:"freezeClaim"` // 冷冻要求 单位小时
  131. common.ControlBy `swaggerignore:"true"`
  132. }
  133. func (s *IceRaftRecordUpdateReq) GetId() interface{} {
  134. return s.Id
  135. }
  136. func (s *IceRaftRecordUpdateReq) Generate(model *model.IceRaftRecord) {
  137. if s.Id != 0 {
  138. model.Id = s.Id
  139. }
  140. model.IceLockerId = s.IceLockerId
  141. model.CoolerBoxId = s.CoolerBoxId
  142. model.FreezeClaim = s.FreezeClaim
  143. if s.ControlBy.UpdateBy != 0 {
  144. model.UpdateBy = s.UpdateBy
  145. }
  146. if s.ControlBy.CreateBy != 0 {
  147. model.CreateBy = s.CreateBy
  148. }
  149. }
  150. type IceRaftRecordDeleteReq struct {
  151. Id int `json:"id"`
  152. common.ControlBy `swaggerignore:"true"`
  153. }
  154. func (s *IceRaftRecordDeleteReq) GetId() interface{} {
  155. return s.Id
  156. }