inspect_expand.go 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. package dto
  2. import (
  3. "gas-cylinder-api/app/admin/model"
  4. "gas-cylinder-api/common/dto"
  5. common "gas-cylinder-api/common/model"
  6. )
  7. // 入库安全检查
  8. type InspectExpandGetPageReq struct {
  9. dto.Pagination `search:"-"`
  10. InspectExpandOrder
  11. }
  12. type InspectExpandOrder struct {
  13. CreatedAtOrder string `search:"type:order;column:created_at;table:inspect_expand" form:"createdAtOrder" default:"asc"`
  14. }
  15. func (m *InspectExpandGetPageReq) GetNeedSearch() interface{} {
  16. return *m
  17. }
  18. type InspectExpandInsertReq struct {
  19. Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码
  20. InspectExplain string `json:"inspectExplain"`
  21. common.ControlBy `swaggerignore:"true"`
  22. common.DeptBy `swaggerignore:"true"`
  23. }
  24. func (s *InspectExpandInsertReq) Generate(model *model.InspectExpand) {
  25. if s.Id != 0 {
  26. model.Id = s.Id
  27. }
  28. model.InspectExplain = s.InspectExplain
  29. if s.ControlBy.UpdateBy != 0 {
  30. model.UpdateBy = s.UpdateBy
  31. }
  32. if s.ControlBy.CreateBy != 0 {
  33. model.CreateBy = s.CreateBy
  34. }
  35. if s.DeptBy.DeptId != 0 {
  36. model.DeptId = s.DeptId
  37. }
  38. }
  39. func (s *InspectExpandInsertReq) GetId() interface{} {
  40. return s.Id
  41. }
  42. func (s *InspectExpandInsertReq) UpdateGenerate(model *model.InspectExpand) {
  43. if s.Id != 0 {
  44. model.Id = s.Id
  45. }
  46. model.InspectExplain = s.InspectExplain
  47. if s.ControlBy.UpdateBy != 0 {
  48. model.UpdateBy = s.UpdateBy
  49. }
  50. if s.ControlBy.CreateBy != 0 {
  51. model.CreateBy = s.CreateBy
  52. }
  53. }
  54. type InspectExpandDeleteReq struct {
  55. Id int `json:"id" vd:"$>0;msg:'id不能为空'"`
  56. common.ControlBy `swaggerignore:"true"`
  57. }
  58. func (s *InspectExpandDeleteReq) GetId() interface{} {
  59. return s.Id
  60. }
  61. type InspectExpandSyncStoreReq struct {
  62. StoreIds []int `json:"storeIds" vd:"len($)>0;msg:'门店id不能为空'"`
  63. common.ControlBy `swaggerignore:"true"`
  64. }