fill_gun.go 2.8 KB

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