ice_raft.go 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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. Label string `json:"label"` // 标签
  41. common.ControlBy `swaggerignore:"true"`
  42. common.DeptBy `swaggerignore:"true"`
  43. }
  44. func (s *IceRaftInsertReq) Generate(model *model.IceRaft, code string) {
  45. if s.Id != 0 {
  46. model.Id = s.Id
  47. }
  48. model.Code = code
  49. model.Status = s.Status
  50. model.FreezeClaim = s.FreezeClaim
  51. model.Label = s.Label
  52. if s.ControlBy.UpdateBy != 0 {
  53. model.UpdateBy = s.UpdateBy
  54. }
  55. if s.ControlBy.CreateBy != 0 {
  56. model.CreateBy = s.CreateBy
  57. }
  58. if s.DeptBy.DeptId != 0 {
  59. model.DeptId = s.DeptId
  60. }
  61. }
  62. func (s *IceRaftInsertReq) GetId() interface{} {
  63. return s.Id
  64. }
  65. type IceRaftUpdateReq struct {
  66. Id int `json:"id" comment:"编码"` // 编码
  67. Label string `json:"label" gorm:"size:128;comment:标签"` // 标签
  68. Code string `json:"code" vd:"len($)>0;msg:'冰排编号不能为空'"` // 冰排名称
  69. Status string `json:"status"` // 1-停用 2-正常
  70. FreezeClaim float32 `json:"freezeClaim"` // 冷冻要求 单位小时
  71. common.ControlBy `swaggerignore:"true"`
  72. }
  73. func (s *IceRaftUpdateReq) Generate(model *model.IceRaft) {
  74. if s.Id != 0 {
  75. model.Id = s.Id
  76. }
  77. model.Code = s.Code
  78. model.Status = s.Status
  79. model.FreezeClaim = s.FreezeClaim
  80. model.Label = s.Label
  81. if s.ControlBy.UpdateBy != 0 {
  82. model.UpdateBy = s.UpdateBy
  83. }
  84. if s.ControlBy.CreateBy != 0 {
  85. model.CreateBy = s.CreateBy
  86. }
  87. }
  88. func (s *IceRaftUpdateReq) GetId() interface{} {
  89. return s.Id
  90. }
  91. type IceRaftGetReq struct {
  92. Id int `uri:"id"`
  93. }
  94. func (s *IceRaftGetReq) GetId() interface{} {
  95. return s.Id
  96. }
  97. type IceRaftGetByCodeReq struct {
  98. Code string `uri:"code"`
  99. }
  100. type IceRaftDeleteReq struct {
  101. Id int `json:"id"`
  102. common.ControlBy `swaggerignore:"true"`
  103. }
  104. func (s *IceRaftDeleteReq) GetId() interface{} {
  105. return s.Id
  106. }
  107. type IceRaftInStorageReq struct {
  108. Code []string `json:"code"`
  109. IceLockerId int `json:"iceLockerId"` // 冷冻柜id
  110. FreezeClaim float32 `json:"freezeClaim"` // 冷冻要求
  111. common.ControlBy `swaggerignore:"true"`
  112. }
  113. type IceRaftOutStorageReq struct {
  114. Code []string `json:"code"`
  115. CoolerBoxId int `json:"coolerBoxId"` // 保温箱id
  116. common.ControlBy `swaggerignore:"true"`
  117. }
  118. type IceRaftRecordGetPageReq struct {
  119. dto.Pagination `search:"-"`
  120. IceRaftId int `form:"iceRaftId" search:"type:exact;column:ice_raft_id;table:ice_raft_record" vd:"$>0;msg:'冰排id不能为空'"` // 冰排id
  121. Status string `form:"status" search:"type:exact;column:status;table:ice_raft_record"` // 状态
  122. IceRaftRecordOrder
  123. }
  124. type IceRaftRecordOrder struct {
  125. CreatedAtOrder string `search:"type:order;column:created_at;table:ice_raft_record" form:"createdAtOrder" default:"desc"`
  126. }
  127. func (m *IceRaftRecordGetPageReq) GetNeedSearch() interface{} {
  128. return *m
  129. }
  130. type IceRaftRecordUpdateReq struct {
  131. Id int `json:"id" comment:"编码"` // 编码
  132. IceLockerId int `json:"iceLockerId"` // 冷冻柜id
  133. CoolerBoxId int `json:"coolerBoxId"` // 保温箱id
  134. FreezeClaim float32 `json:"freezeClaim"` // 冷冻要求 单位小时
  135. common.ControlBy `swaggerignore:"true"`
  136. }
  137. func (s *IceRaftRecordUpdateReq) GetId() interface{} {
  138. return s.Id
  139. }
  140. func (s *IceRaftRecordUpdateReq) Generate(model *model.IceRaftRecord) {
  141. if s.Id != 0 {
  142. model.Id = s.Id
  143. }
  144. model.IceLockerId = s.IceLockerId
  145. model.CoolerBoxId = s.CoolerBoxId
  146. model.FreezeClaim = s.FreezeClaim
  147. if s.ControlBy.UpdateBy != 0 {
  148. model.UpdateBy = s.UpdateBy
  149. }
  150. if s.ControlBy.CreateBy != 0 {
  151. model.CreateBy = s.CreateBy
  152. }
  153. }
  154. type IceRaftRecordDeleteReq struct {
  155. Id int `json:"id"`
  156. common.ControlBy `swaggerignore:"true"`
  157. }
  158. func (s *IceRaftRecordDeleteReq) GetId() interface{} {
  159. return s.Id
  160. }