gas_cylinder_spec.go 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 GasCylinderSpecGetPageReq struct {
  8. dto.Pagination `search:"-"`
  9. Name string `form:"name" search:"type:contains;column:name;table:dispatch_cost"` // 商品名称
  10. }
  11. func (m *GasCylinderSpecGetPageReq) GetNeedSearch() interface{} {
  12. return *m
  13. }
  14. type GasCylinderSpecInsertReq struct {
  15. Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码
  16. Name string `json:"name"` // 商品名称
  17. Remark string `json:"remark"` // 备注
  18. common.ControlBy `swaggerignore:"true"`
  19. common.DeptBy `swaggerignore:"true"`
  20. }
  21. func (s *GasCylinderSpecInsertReq) Generate(model *model.GasCylinderSpec) {
  22. if s.Id != 0 {
  23. model.Id = s.Id
  24. }
  25. model.Name = s.Name
  26. model.Remark = s.Remark
  27. if s.ControlBy.UpdateBy != 0 {
  28. model.UpdateBy = s.UpdateBy
  29. }
  30. if s.ControlBy.CreateBy != 0 {
  31. model.CreateBy = s.CreateBy
  32. }
  33. if s.DeptBy.DeptId != 0 {
  34. model.DeptId = s.DeptId
  35. }
  36. }
  37. func (s *GasCylinderSpecInsertReq) GetId() interface{} {
  38. return s.Id
  39. }
  40. type GasCylinderSpecUpdateReq struct {
  41. Id int `json:"id" comment:"编码"` // 编码
  42. Name string `json:"name"` // 商品名称
  43. Remark string `json:"remark"` // 备注
  44. common.ControlBy `swaggerignore:"true"`
  45. }
  46. func (s *GasCylinderSpecUpdateReq) Generate(model *model.GasCylinderSpec) {
  47. if s.Id != 0 {
  48. model.Id = s.Id
  49. }
  50. model.Name = s.Name
  51. model.Remark = s.Remark
  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. }
  59. func (s *GasCylinderSpecUpdateReq) GetId() interface{} {
  60. return s.Id
  61. }
  62. type GasCylinderSpecGetReq struct {
  63. Id int `uri:"id"`
  64. }
  65. func (s *GasCylinderSpecGetReq) GetId() interface{} {
  66. return s.Id
  67. }
  68. type GasCylinderSpecDeleteReq struct {
  69. Id int `json:"id"`
  70. common.ControlBy `swaggerignore:"true"`
  71. }
  72. func (s *GasCylinderSpecDeleteReq) GetId() interface{} {
  73. return s.Id
  74. }