ot_apps.go 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. package dto
  2. import (
  3. "go-admin/app/admin/models"
  4. "go-admin/common/dto"
  5. common "go-admin/common/models"
  6. )
  7. type OtAppsGetPageReq struct {
  8. dto.Pagination `search:"-"`
  9. Name string `form:"name" search:"type:contains;column:name;table:ot_apps" comment:"业务名"`
  10. Alias string `form:"alias" search:"type:contains;column:alias;table:ot_apps" comment:"业务别名"`
  11. ContractInfo string `form:"contractInfo" search:"type:exact;column:contract_info;table:ot_apps" comment:"管理信息"`
  12. ContractPhone string `form:"contractPhone" search:"type:exact;column:contract_phone;table:ot_apps" comment:"管理员手机号"`
  13. OtAppsOrder
  14. }
  15. type OtAppsOrder struct {
  16. Id string `form:"idOrder" search:"type:order;column:id;table:ot_apps"`
  17. CreatedAt string `form:"createdAtOrder" search:"type:order;column:created_at;table:ot_apps"`
  18. UpdatedAt string `form:"updatedAtOrder" search:"type:order;column:updated_at;table:ot_apps"`
  19. DeletedAt string `form:"deletedAtOrder" search:"type:order;column:deleted_at;table:ot_apps"`
  20. CreateBy string `form:"createByOrder" search:"type:order;column:create_by;table:ot_apps"`
  21. UpdateBy string `form:"updateByOrder" search:"type:order;column:update_by;table:ot_apps"`
  22. Name string `form:"nameOrder" search:"type:order;column:name;table:ot_apps"`
  23. Alias string `form:"aliasOrder" search:"type:order;column:alias;table:ot_apps"`
  24. Desc string `form:"descOrder" search:"type:order;column:desc;table:ot_apps"`
  25. ImgUrl string `form:"imgUrlOrder" search:"type:order;column:img_url;table:ot_apps"`
  26. ContractInfo string `form:"contractInfoOrder" search:"type:order;column:contract_info;table:ot_apps"`
  27. ContractPhone string `form:"contractPhoneOrder" search:"type:order;column:contract_phone;table:ot_apps"`
  28. }
  29. func (m *OtAppsGetPageReq) GetNeedSearch() interface{} {
  30. return *m
  31. }
  32. type OtAppsInsertReq struct {
  33. Id int `json:"-" comment:""`
  34. Name string `json:"name" comment:"业务名"`
  35. Alias string `json:"alias" comment:"业务别名"`
  36. Desc string `json:"desc" comment:"业务描述"`
  37. ImgUrl string `json:"imgUrl" comment:"业务图片"`
  38. ContractInfo string `json:"contractInfo" comment:"管理信息"`
  39. ContractPhone string `json:"contractPhone" comment:"管理员手机号"`
  40. ServiceNames []string `json:"serviceNames" comment:"关联的服务名称"`
  41. common.ControlBy
  42. }
  43. func (s *OtAppsInsertReq) Generate(model *models.OtApps) {
  44. if s.Id == 0 {
  45. model.Model = common.Model{Id: s.Id}
  46. }
  47. model.CreateBy = s.CreateBy // 添加这而,需要记录是被谁创建的
  48. model.Name = s.Name
  49. model.Alias = s.Alias
  50. model.Desc = s.Desc
  51. model.ImgUrl = s.ImgUrl
  52. model.ContractInfo = s.ContractInfo
  53. model.ContractPhone = s.ContractPhone
  54. }
  55. func (s *OtAppsInsertReq) GetId() interface{} {
  56. return s.Id
  57. }
  58. type OtAppsUpdateReq struct {
  59. Id int `uri:"id" comment:""` //
  60. Name string `json:"name" comment:"业务名"`
  61. Alias string `json:"alias" comment:"业务别名"`
  62. Desc string `json:"desc" comment:"业务描述"`
  63. ImgUrl string `json:"imgUrl" comment:"业务图片"`
  64. ContractInfo string `json:"contractInfo" comment:"管理信息"`
  65. ContractPhone string `json:"contractPhone" comment:"管理员手机号"`
  66. ServiceNames []string `json:"serviceNames" comment:"AppAlias关联的服务名称"`
  67. common.ControlBy
  68. }
  69. func (s *OtAppsUpdateReq) Generate(model *models.OtApps) {
  70. if s.Id == 0 {
  71. model.Model = common.Model{Id: s.Id}
  72. }
  73. model.UpdateBy = s.UpdateBy // 添加这而,需要记录是被谁更新的
  74. model.Name = s.Name
  75. model.Alias = s.Alias
  76. model.Desc = s.Desc
  77. model.ImgUrl = s.ImgUrl
  78. model.ContractInfo = s.ContractInfo
  79. model.ContractPhone = s.ContractPhone
  80. }
  81. func (s *OtAppsUpdateReq) GetId() interface{} {
  82. return s.Id
  83. }
  84. // OtAppsGetReq 功能获取请求参数
  85. type OtAppsGetReq struct {
  86. Id int `uri:"id"`
  87. }
  88. func (s *OtAppsGetReq) GetId() interface{} {
  89. return s.Id
  90. }
  91. // OtAppsDeleteReq 功能删除请求参数
  92. type OtAppsDeleteReq struct {
  93. Ids []int `json:"ids"`
  94. }
  95. func (s *OtAppsDeleteReq) GetId() interface{} {
  96. return s.Ids
  97. }