ot_iframe.go 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 OtIframGetPageReq struct {
  8. dto.Pagination `search:"-"`
  9. Url string `form:"url" search:"type:exact;column:url;table:ot_iframe" comment:"iframe地址"`
  10. PageTag string `form:"pageTag" search:"type:exact;column:page_tag;table:ot_iframe" comment:"页面标识"`
  11. AppId int64 `form:"appId" search:"type:exact;column:app_id;table:ot_iframe" comment:"AppID"`
  12. Overall int64 `form:"overall" search:"type:exact;column:overall;table:ot_iframe" comment:"Overall 全局可用"`
  13. OtIframOrder
  14. }
  15. type OtIframOrder struct {
  16. Id string `form:"idOrder" search:"type:order;column:id;table:ot_iframe"`
  17. CreatedAt string `form:"createdAtOrder" search:"type:order;column:created_at;table:ot_iframe"`
  18. UpdatedAt string `form:"updatedAtOrder" search:"type:order;column:updated_at;table:ot_iframe"`
  19. DeletedAt string `form:"deletedAtOrder" search:"type:order;column:deleted_at;table:ot_iframe"`
  20. CreateBy string `form:"createByOrder" search:"type:order;column:create_by;table:ot_iframe"`
  21. UpdateBy string `form:"updateByOrder" search:"type:order;column:update_by;table:ot_iframe"`
  22. Desc string `form:"descOrder" search:"type:order;column:desc;table:ot_iframe"`
  23. Url string `form:"urlOrder" search:"type:order;column:url;table:ot_iframe"`
  24. PageTag string `form:"pageTagOrder" search:"type:order;column:page_tag;table:ot_iframe"`
  25. AppId string `form:"appIdOrder" search:"type:order;column:app_id;table:ot_iframe"`
  26. Overall string `form:"overallOrder" search:"type:order;column:overall;table:ot_iframe"`
  27. }
  28. func (m *OtIframGetPageReq) GetNeedSearch() interface{} {
  29. return *m
  30. }
  31. type OtIframInsertReq struct {
  32. Id int `json:"-" comment:""` //
  33. Desc string `json:"desc" comment:""`
  34. Url string `json:"url" comment:"iframe地址"`
  35. PageTag string `json:"pageTag" comment:"页面标识"`
  36. AppId int64 `json:"appId" comment:"AppID"`
  37. Overall int64 `json:"overall" comment:"Overall"`
  38. common.ControlBy
  39. }
  40. func (s *OtIframInsertReq) Generate(model *models.OtIfram) {
  41. if s.Id == 0 {
  42. model.Model = common.Model{Id: s.Id}
  43. }
  44. model.CreateBy = s.CreateBy // 添加这而,需要记录是被谁创建的
  45. model.Desc = s.Desc
  46. model.Url = s.Url
  47. model.PageTag = s.PageTag
  48. model.AppId = s.AppId
  49. model.Overall = s.Overall
  50. }
  51. func (s *OtIframInsertReq) GetId() interface{} {
  52. return s.Id
  53. }
  54. type OtIframUpdateReq struct {
  55. Id int `uri:"id" comment:""` //
  56. Desc string `json:"desc" comment:""`
  57. Url string `json:"url" comment:"iframe地址"`
  58. PageTag string `json:"pageTag" comment:"页面标识"`
  59. AppId int64 `json:"appId" comment:"AppID"`
  60. Overall int64 `json:"overall" comment:"Overall"`
  61. common.ControlBy
  62. }
  63. func (s *OtIframUpdateReq) Generate(model *models.OtIfram) {
  64. if s.Id == 0 {
  65. model.Model = common.Model{Id: s.Id}
  66. }
  67. model.UpdateBy = s.UpdateBy // 添加这而,需要记录是被谁更新的
  68. model.Desc = s.Desc
  69. model.Url = s.Url
  70. model.PageTag = s.PageTag
  71. model.AppId = s.AppId
  72. model.Overall = s.Overall
  73. }
  74. func (s *OtIframUpdateReq) GetId() interface{} {
  75. return s.Id
  76. }
  77. // OtIframGetReq 功能获取请求参数
  78. type OtIframGetReq struct {
  79. Id int `uri:"id"`
  80. }
  81. func (s *OtIframGetReq) GetId() interface{} {
  82. return s.Id
  83. }
  84. // OtIframDeleteReq 功能删除请求参数
  85. type OtIframDeleteReq struct {
  86. Ids []int `json:"ids"`
  87. }
  88. func (s *OtIframDeleteReq) GetId() interface{} {
  89. return s.Ids
  90. }