gas_cylinder_spec.go 2.3 KB

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