ot_plugins.go 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 OtPluginsGetPageReq struct {
  8. dto.Pagination `search:"-"`
  9. Name string `form:"name" search:"type:contains;column:name;table:ot_plugins" comment:"插件名"`
  10. Alias string `form:"alias" search:"type:contains;column:alias;table:ot_plugins" comment:"插件英文别名"`
  11. OtPluginsOrder
  12. }
  13. type OtPluginsOrder struct {
  14. Id string `form:"idOrder" search:"type:order;column:id;table:ot_plugins"`
  15. CreatedAt string `form:"createdAtOrder" search:"type:order;column:created_at;table:ot_plugins"`
  16. UpdatedAt string `form:"updatedAtOrder" search:"type:order;column:updated_at;table:ot_plugins"`
  17. DeletedAt string `form:"deletedAtOrder" search:"type:order;column:deleted_at;table:ot_plugins"`
  18. CreateBy string `form:"createByOrder" search:"type:order;column:create_by;table:ot_plugins"`
  19. UpdateBy string `form:"updateByOrder" search:"type:order;column:update_by;table:ot_plugins"`
  20. Name string `form:"nameOrder" search:"type:order;column:name;table:ot_plugins"`
  21. Alias string `form:"aliasOrder" search:"type:order;column:alias;table:ot_plugins"`
  22. Url string `form:"urlOrder" search:"type:order;column:url;table:ot_plugins"`
  23. Config string `form:"configOrder" search:"type:order;column:config;table:ot_plugins"`
  24. }
  25. func (m *OtPluginsGetPageReq) GetNeedSearch() interface{} {
  26. return *m
  27. }
  28. type OtPluginsInsertReq struct {
  29. Id int `json:"-" comment:""` //
  30. Name string `json:"name" comment:"插件名"`
  31. Alias string `json:"alias" comment:"插件英文别名"`
  32. Url string `json:"url" comment:"插件地址"`
  33. Config string `json:"config" comment:"配置json格式"`
  34. common.ControlBy
  35. }
  36. func (s *OtPluginsInsertReq) Generate(model *models.OtPlugins) {
  37. if s.Id == 0 {
  38. model.Model = common.Model{Id: s.Id}
  39. }
  40. model.CreateBy = s.CreateBy // 添加这而,需要记录是被谁创建的
  41. model.Name = s.Name
  42. model.Alias = s.Alias
  43. model.Url = s.Url
  44. model.Config = s.Config
  45. }
  46. func (s *OtPluginsInsertReq) GetId() interface{} {
  47. return s.Id
  48. }
  49. type OtPluginsUpdateReq struct {
  50. Id int `uri:"id" comment:""` //
  51. Name string `json:"name" comment:"插件名"`
  52. Alias string `json:"alias" comment:"插件英文别名"`
  53. Url string `json:"url" comment:"插件地址"`
  54. Config string `json:"config" comment:"配置json格式"`
  55. common.ControlBy
  56. }
  57. func (s *OtPluginsUpdateReq) Generate(model *models.OtPlugins) {
  58. if s.Id == 0 {
  59. model.Model = common.Model{Id: s.Id}
  60. }
  61. model.UpdateBy = s.UpdateBy // 添加这而,需要记录是被谁更新的
  62. model.Name = s.Name
  63. model.Alias = s.Alias
  64. model.Url = s.Url
  65. model.Config = s.Config
  66. }
  67. func (s *OtPluginsUpdateReq) GetId() interface{} {
  68. return s.Id
  69. }
  70. // OtPluginsGetReq 功能获取请求参数
  71. type OtPluginsGetReq struct {
  72. Id int `uri:"id"`
  73. }
  74. func (s *OtPluginsGetReq) GetId() interface{} {
  75. return s.Id
  76. }
  77. // OtPluginsDeleteReq 功能删除请求参数
  78. type OtPluginsDeleteReq struct {
  79. Ids []int `json:"ids"`
  80. }
  81. func (s *OtPluginsDeleteReq) GetId() interface{} {
  82. return s.Ids
  83. }