ot_app_dashboard.go 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 OtAppDashboardGetPageReq struct {
  8. dto.Pagination `search:"-"`
  9. OtAppDashboardOrder
  10. }
  11. type OtAppDashboardOrder struct {
  12. Id string `form:"idOrder" search:"type:order;column:id;table:ot_app_dashboard"`
  13. CreatedAt string `form:"createdAtOrder" search:"type:order;column:created_at;table:ot_app_dashboard"`
  14. UpdatedAt string `form:"updatedAtOrder" search:"type:order;column:updated_at;table:ot_app_dashboard"`
  15. DeletedAt string `form:"deletedAtOrder" search:"type:order;column:deleted_at;table:ot_app_dashboard"`
  16. CreateBy string `form:"createByOrder" search:"type:order;column:create_by;table:ot_app_dashboard"`
  17. UpdateBy string `form:"updateByOrder" search:"type:order;column:update_by;table:ot_app_dashboard"`
  18. AppId string `form:"appIdOrder" search:"type:order;column:app_id;table:ot_app_dashboard"`
  19. DashboardUid string `form:"dashboardUidOrder" search:"type:order;column:dashboard_uid;table:ot_app_dashboard"`
  20. }
  21. func (m *OtAppDashboardGetPageReq) GetNeedSearch() interface{} {
  22. return *m
  23. }
  24. type OtAppDashboardInsertReq struct {
  25. Id int `json:"-" comment:""` //
  26. AppId int64 `json:"appId" comment:"应用ID"`
  27. DashboardUid string `json:"dashboardUid" comment:"grafana dashboard uid"`
  28. common.ControlBy
  29. }
  30. func (s *OtAppDashboardInsertReq) Generate(model *models.OtAppDashboard) {
  31. if s.Id == 0 {
  32. model.Model = common.Model{Id: s.Id}
  33. }
  34. model.CreateBy = s.CreateBy // 添加这而,需要记录是被谁创建的
  35. model.AppId = s.AppId
  36. model.DashboardUid = s.DashboardUid
  37. }
  38. func (s *OtAppDashboardInsertReq) GetId() interface{} {
  39. return s.Id
  40. }
  41. type OtAppDashboardUpdateReq struct {
  42. Id int `uri:"id" comment:""` //
  43. AppId int64 `json:"appId" comment:"应用ID"`
  44. DashboardUid string `json:"dashboardUid" comment:"grafana dashboard uid"`
  45. common.ControlBy
  46. }
  47. func (s *OtAppDashboardUpdateReq) Generate(model *models.OtAppDashboard) {
  48. if s.Id == 0 {
  49. model.Model = common.Model{Id: s.Id}
  50. }
  51. model.UpdateBy = s.UpdateBy // 添加这而,需要记录是被谁更新的
  52. model.AppId = s.AppId
  53. model.DashboardUid = s.DashboardUid
  54. }
  55. func (s *OtAppDashboardUpdateReq) GetId() interface{} {
  56. return s.Id
  57. }
  58. // OtAppDashboardGetReq 功能获取请求参数
  59. type OtAppDashboardGetReq struct {
  60. Id int `uri:"id"`
  61. }
  62. func (s *OtAppDashboardGetReq) GetId() interface{} {
  63. return s.Id
  64. }
  65. // OtAppDashboardDeleteReq 功能删除请求参数
  66. type OtAppDashboardDeleteReq struct {
  67. Ids []int `json:"ids"`
  68. }
  69. func (s *OtAppDashboardDeleteReq) GetId() interface{} {
  70. return s.Ids
  71. }
  72. type OtAppDashboardGetByAppReq struct {
  73. AppId int64 `uri:"appid"`
  74. }