sys_dict_data_dto.go 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. package dto
  2. import (
  3. "Medical_OAuth/app/admin/model"
  4. "Medical_OAuth/common/dto"
  5. common "Medical_OAuth/common/model"
  6. )
  7. type SysDictDataGetPageReq struct {
  8. dto.Pagination `search:"-"`
  9. Id int `form:"id" search:"type:exact;column:dict_code;table:sys_dict_data" comment:""`
  10. DictLabel string `form:"dictLabel" search:"type:contains;column:dict_label;table:sys_dict_data" comment:""`
  11. DictValue string `form:"dictValue" search:"type:contains;column:dict_value;table:sys_dict_data" comment:""`
  12. DictType string `form:"dictType" search:"type:contains;column:dict_type;table:sys_dict_data" comment:""`
  13. Status string `form:"status" search:"type:exact;column:status;table:sys_dict_data" comment:""`
  14. }
  15. func (m *SysDictDataGetPageReq) GetNeedSearch() interface{} {
  16. return *m
  17. }
  18. type SysDictDataGetAllResp struct {
  19. DictLabel string `json:"label"`
  20. DictValue string `json:"value"`
  21. }
  22. type SysDictDataInsertReq struct {
  23. Id int `json:"-" comment:"" swaggerignore:"true"`
  24. DictSort int `json:"dictSort" comment:""`
  25. DictLabel string `json:"dictLabel" comment:""`
  26. DictValue string `json:"dictValue" comment:""`
  27. DictType string `json:"dictType" comment:""`
  28. CssClass string `json:"cssClass" comment:""`
  29. ListClass string `json:"listClass" comment:""`
  30. IsDefault string `json:"isDefault" comment:""`
  31. Status int `json:"status" comment:""`
  32. Default string `json:"default" comment:""`
  33. Remark string `json:"remark" comment:""`
  34. common.ControlBy `swaggerignore:"true"`
  35. }
  36. func (s *SysDictDataInsertReq) Generate(model *model.SysDictData) {
  37. model.DictCode = s.Id
  38. model.DictSort = s.DictSort
  39. model.DictLabel = s.DictLabel
  40. model.DictValue = s.DictValue
  41. model.DictType = s.DictType
  42. model.CssClass = s.CssClass
  43. model.ListClass = s.ListClass
  44. model.IsDefault = s.IsDefault
  45. model.Status = s.Status
  46. model.Default = s.Default
  47. model.Remark = s.Remark
  48. if s.ControlBy.UpdateBy != 0 {
  49. model.UpdateBy = s.UpdateBy
  50. }
  51. if s.ControlBy.CreateBy != 0 {
  52. model.CreateBy = s.CreateBy
  53. }
  54. }
  55. func (s *SysDictDataInsertReq) GetId() interface{} {
  56. return s.Id
  57. }
  58. type SysDictDataUpdateReq struct {
  59. Id int `uri:"dictCode" comment:""`
  60. DictSort int `json:"dictSort" comment:""`
  61. DictLabel string `json:"dictLabel" comment:""`
  62. DictValue string `json:"dictValue" comment:""`
  63. DictType string `json:"dictType" comment:""`
  64. CssClass string `json:"cssClass" comment:""`
  65. ListClass string `json:"listClass" comment:""`
  66. IsDefault string `json:"isDefault" comment:""`
  67. Status int `json:"status" comment:""`
  68. Default string `json:"default" comment:""`
  69. Remark string `json:"remark" comment:""`
  70. common.ControlBy `swaggerignore:"true"`
  71. }
  72. func (s *SysDictDataUpdateReq) Generate(model *model.SysDictData) {
  73. model.DictCode = s.Id
  74. model.DictSort = s.DictSort
  75. model.DictLabel = s.DictLabel
  76. model.DictValue = s.DictValue
  77. model.DictType = s.DictType
  78. model.CssClass = s.CssClass
  79. model.ListClass = s.ListClass
  80. model.IsDefault = s.IsDefault
  81. model.Status = s.Status
  82. model.Default = s.Default
  83. model.Remark = s.Remark
  84. if s.ControlBy.UpdateBy != 0 {
  85. model.UpdateBy = s.UpdateBy
  86. }
  87. if s.ControlBy.CreateBy != 0 {
  88. model.CreateBy = s.CreateBy
  89. }
  90. }
  91. func (s *SysDictDataUpdateReq) GetId() interface{} {
  92. return s.Id
  93. }
  94. type SysDictDataGetReq struct {
  95. Id int `uri:"dictCode"`
  96. }
  97. func (s *SysDictDataGetReq) GetId() interface{} {
  98. return s.Id
  99. }
  100. type SysDictDataDeleteReq struct {
  101. Ids []int `json:"ids"`
  102. common.ControlBy `swaggerignore:"true"`
  103. }
  104. func (s *SysDictDataDeleteReq) GetId() interface{} {
  105. return s.Ids
  106. }