fill_gun.go 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. type FillGunGetPageReq struct {
  8. dto.Pagination `search:"-"`
  9. CustomerId string `form:"customerId" search:"type:contains;column:customer_id;table:address"` // 角色名称
  10. }
  11. func (m *FillGunGetPageReq) GetNeedSearch() interface{} {
  12. return *m
  13. }
  14. type FillGunInsertReq struct {
  15. Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码
  16. GunCode string `json:"gunCode"` // 充装枪编码
  17. ScanGunCode string `json:"scanGunCode"` // 扫描枪编码
  18. PersonCode string `json:"personCode"` // 充装人员编码
  19. Remark string `json:"remark"` // 备注
  20. common.ControlBy `swaggerignore:"true"`
  21. common.DeptBy `swaggerignore:"true"`
  22. }
  23. func (s *FillGunInsertReq) Generate(m *model.FillGun) {
  24. if s.Id != 0 {
  25. m.Id = s.Id
  26. }
  27. m.GunCode = s.GunCode
  28. m.ScanGunCode = s.ScanGunCode
  29. m.PersonCode = s.PersonCode
  30. m.Remark = s.Remark
  31. if s.ControlBy.UpdateBy != 0 {
  32. m.UpdateBy = s.UpdateBy
  33. }
  34. if s.ControlBy.CreateBy != 0 {
  35. m.CreateBy = s.CreateBy
  36. }
  37. if s.DeptBy.DeptId != 0 {
  38. m.DeptId = s.DeptId
  39. }
  40. }
  41. func (s *FillGunInsertReq) GetId() interface{} {
  42. return s.Id
  43. }
  44. type FillGunUpdateReq struct {
  45. Id int `json:"id" comment:"编码"` // 编码
  46. GunCode string `json:"gunCode"` // 充装枪编码
  47. ScanGunCode string `json:"scanGunCode"` // 扫描枪编码
  48. PersonCode string `json:"personCode"` // 充装人员编码
  49. Remark string `json:"remark"` // 备注
  50. common.ControlBy `swaggerignore:"true"`
  51. }
  52. func (s *FillGunUpdateReq) Generate(m *model.FillGun) {
  53. if s.Id != 0 {
  54. m.Id = s.Id
  55. }
  56. m.GunCode = s.GunCode
  57. m.ScanGunCode = s.ScanGunCode
  58. m.PersonCode = s.PersonCode
  59. m.Remark = s.Remark
  60. if s.ControlBy.UpdateBy != 0 {
  61. m.UpdateBy = s.UpdateBy
  62. }
  63. if s.ControlBy.CreateBy != 0 {
  64. m.CreateBy = s.CreateBy
  65. }
  66. }
  67. func (s *FillGunUpdateReq) GetId() interface{} {
  68. return s.Id
  69. }
  70. type FillGunGetReq struct {
  71. Id int `uri:"id"`
  72. }
  73. func (s *FillGunGetReq) GetId() interface{} {
  74. return s.Id
  75. }
  76. type FillGunDeleteReq struct {
  77. Id int `json:"id"`
  78. common.ControlBy `swaggerignore:"true"`
  79. }
  80. func (s *FillGunDeleteReq) GetId() interface{} {
  81. return s.Id
  82. }