dispatch_cost.go 2.2 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 DispatchCostGetPageReq struct {
  8. dto.Pagination `search:"-"`
  9. Name string `form:"name" search:"type:contains;column:name;table:dispatch_cost"` // 商品名称
  10. }
  11. func (m *DispatchCostGetPageReq) GetNeedSearch() interface{} {
  12. return *m
  13. }
  14. type DispatchCostInsertReq struct {
  15. Id int `json:"id" comment:"编码" swaggerignore:"true"` // 编码
  16. Name string `json:"name"` // 商品名称
  17. Price float64 `json:"price"` // 价格
  18. Remark string `json:"remark"` // 备注
  19. common.ControlBy `swaggerignore:"true"`
  20. common.DeptBy `swaggerignore:"true"`
  21. }
  22. func (s *DispatchCostInsertReq) Generate(model *model.DispatchCost) {
  23. if s.Id != 0 {
  24. model.Id = s.Id
  25. }
  26. model.Name = s.Name
  27. model.Price = s.Price
  28. model.Remark = s.Remark
  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 *DispatchCostInsertReq) GetId() interface{} {
  40. return s.Id
  41. }
  42. type DispatchCostUpdateReq struct {
  43. Id int `json:"id" comment:"编码"` // 编码
  44. Name string `json:"name"` // 商品名称
  45. Price float64 `json:"price"` // 价格
  46. Remark string `json:"remark"` // 备注
  47. common.ControlBy `swaggerignore:"true"`
  48. }
  49. func (s *DispatchCostUpdateReq) Generate(model *model.DispatchCost) {
  50. if s.Id != 0 {
  51. model.Id = s.Id
  52. }
  53. model.Name = s.Name
  54. model.Price = s.Price
  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 *DispatchCostUpdateReq) GetId() interface{} {
  64. return s.Id
  65. }
  66. type DispatchCostGetReq struct {
  67. Id int `uri:"id"`
  68. }
  69. func (s *DispatchCostGetReq) GetId() interface{} {
  70. return s.Id
  71. }
  72. type DispatchCostDeleteReq struct {
  73. Id int `json:"id"`
  74. common.ControlBy `swaggerignore:"true"`
  75. }
  76. func (s *DispatchCostDeleteReq) GetId() interface{} {
  77. return s.Id
  78. }