ot_fire_events.go 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. package dto
  2. import (
  3. "time"
  4. "go-admin/app/admin/models"
  5. "go-admin/common/dto"
  6. common "go-admin/common/models"
  7. )
  8. type OtFireEventsGetPageReq struct {
  9. dto.Pagination `search:"-"`
  10. AppId int64 `form:"appId" search:"type:exact;column:app_id;table:ot_fire_events" comment:"业务ID"`
  11. RuleId int64 `form:"ruleId" search:"type:exact;column:rule_id;table:ot_fire_events" comment:""`
  12. ExceptionName string `form:"exceptionName" search:"type:contains;column:exception_name;table:ot_fire_events" comment:"告警名称/信息"`
  13. AppName string `form:"appName" search:"type:exact;column:app_name;table:ot_fire_events" comment:""`
  14. AppAlias string `form:"appAlias" search:"type:exact;column:app_alias;table:ot_fire_events" comment:""`
  15. AlertStatus int64 `form:"alertStatus" search:"type:exact;column:alert_status;table:ot_fire_events" comment:""`
  16. IsKnow int64 `form:"isKnow" search:"type:exact;column:is_know;table:ot_fire_events" comment:"已知悉"`
  17. IsResolve int64 `form:"isResolve" search:"type:exact;column:is_resolve;table:ot_fire_events" comment:"已解决"`
  18. IsIgnore int64 `form:"isIgnore" search:"type:exact;column:is_ignore;table:ot_fire_events" comment:"已忽略"`
  19. OtFireEventsOrder
  20. }
  21. type OtFireEventsOrder struct {
  22. Id string `form:"idOrder" search:"type:order;column:id;table:ot_fire_events"`
  23. AppId string `form:"appIdOrder" search:"type:order;column:app_id;table:ot_fire_events"`
  24. RuleId string `form:"ruleIdOrder" search:"type:order;column:rule_id;table:ot_fire_events"`
  25. ExceptionName string `form:"exceptionNameOrder" search:"type:order;column:exception_name;table:ot_fire_events"`
  26. RecordTime string `form:"recordTimeOrder" search:"type:order;column:record_time;table:ot_fire_events"`
  27. AppendTime string `form:"appendTimeOrder" search:"type:order;column:append_time;table:ot_fire_events"`
  28. Uid string `form:"uidOrder" search:"type:order;column:uid;table:ot_fire_events"`
  29. AppName string `form:"appNameOrder" search:"type:order;column:app_name;table:ot_fire_events"`
  30. AppAlias string `form:"appAliasOrder" search:"type:order;column:app_alias;table:ot_fire_events"`
  31. RuleInfo string `form:"ruleInfoOrder" search:"type:order;column:rule_info;table:ot_fire_events"`
  32. RowResult string `form:"rowResultOrder" search:"type:order;column:row_result;table:ot_fire_events"`
  33. RowsResult string `form:"rowsResultOrder" search:"type:order;column:rows_result;table:ot_fire_events"`
  34. AlertStatus string `form:"alertStatusOrder" search:"type:order;column:alert_status;table:ot_fire_events"`
  35. IsKnow string `form:"isKnowOrder" search:"type:order;column:is_know;table:ot_fire_events"`
  36. IsResolve string `form:"isResolveOrder" search:"type:order;column:is_resolve;table:ot_fire_events"`
  37. IsIgnore string `form:"isIgnoreOrder" search:"type:order;column:is_ignore;table:ot_fire_events"`
  38. CreatedAt string `form:"createdAtOrder" search:"type:order;column:created_at;table:ot_fire_events"`
  39. UpdatedAt string `form:"updatedAtOrder" search:"type:order;column:updated_at;table:ot_fire_events"`
  40. DeletedAt string `form:"deletedAtOrder" search:"type:order;column:deleted_at;table:ot_fire_events"`
  41. CreateBy string `form:"createByOrder" search:"type:order;column:create_by;table:ot_fire_events"`
  42. UpdateBy string `form:"updateByOrder" search:"type:order;column:update_by;table:ot_fire_events"`
  43. }
  44. func (m *OtFireEventsGetPageReq) GetNeedSearch() interface{} {
  45. return *m
  46. }
  47. type OtFireEventsInsertReq struct {
  48. Id int `json:"-" comment:"业务应用告警规则表"` // 业务应用告警规则表
  49. AppId int64 `json:"appId" comment:"业务ID"`
  50. RuleId int64 `json:"ruleId" comment:""`
  51. ExceptionName string `json:"exceptionName" comment:"告警名称/信息"`
  52. RecordTime time.Time `json:"recordTime" comment:""`
  53. AppendTime time.Time `json:"appendTime" comment:""`
  54. Uid string `json:"uid" comment:""`
  55. AppName string `json:"appName" comment:""`
  56. AppAlias string `json:"appAlias" comment:""`
  57. RuleInfo string `json:"ruleInfo" comment:""`
  58. RowResult string `json:"rowResult" comment:""`
  59. RowsResult string `json:"rowsResult" comment:""`
  60. AlertStatus int64 `json:"alertStatus" comment:""`
  61. IsKnow int64 `json:"isKnow" comment:"已知悉"`
  62. IsResolve int64 `json:"isResolve" comment:"已解决"`
  63. IsIgnore int64 `json:"isIgnore" comment:"已忽略"`
  64. common.ControlBy
  65. }
  66. func (s *OtFireEventsInsertReq) Generate(model *models.OtFireEvents) {
  67. if s.Id == 0 {
  68. model.Model = common.Model{Id: s.Id}
  69. }
  70. model.AppId = s.AppId
  71. model.RuleId = s.RuleId
  72. model.ExceptionName = s.ExceptionName
  73. model.RecordTime = s.RecordTime
  74. model.AppendTime = s.AppendTime
  75. model.Uid = s.Uid
  76. model.AppName = s.AppName
  77. model.AppAlias = s.AppAlias
  78. model.RuleInfo = s.RuleInfo
  79. model.RowResult = s.RowResult
  80. model.RowsResult = s.RowsResult
  81. model.AlertStatus = s.AlertStatus
  82. model.IsKnow = s.IsKnow
  83. model.IsResolve = s.IsResolve
  84. model.IsIgnore = s.IsIgnore
  85. model.CreateBy = s.CreateBy // 添加这而,需要记录是被谁创建的
  86. }
  87. func (s *OtFireEventsInsertReq) GetId() interface{} {
  88. return s.Id
  89. }
  90. type OtFireEventsUpdateReq struct {
  91. Id int `uri:"id" comment:"业务应用告警规则表"` // 业务应用告警规则表
  92. AppId int64 `json:"appId" comment:"业务ID"`
  93. RuleId int64 `json:"ruleId" comment:""`
  94. ExceptionName string `json:"exceptionName" comment:"告警名称/信息"`
  95. RecordTime time.Time `json:"recordTime" comment:""`
  96. AppendTime time.Time `json:"appendTime" comment:""`
  97. Uid string `json:"uid" comment:""`
  98. AppName string `json:"appName" comment:""`
  99. AppAlias string `json:"appAlias" comment:""`
  100. RuleInfo string `json:"ruleInfo" comment:""`
  101. RowResult string `json:"rowResult" comment:""`
  102. RowsResult string `json:"rowsResult" comment:""`
  103. AlertStatus int64 `json:"alertStatus" comment:""`
  104. IsKnow int64 `json:"isKnow" comment:"已知悉"`
  105. IsResolve int64 `json:"isResolve" comment:"已解决"`
  106. IsIgnore int64 `json:"isIgnore" comment:"已忽略"`
  107. common.ControlBy
  108. }
  109. func (s *OtFireEventsUpdateReq) Generate(model *models.OtFireEvents) {
  110. if s.Id == 0 {
  111. model.Model = common.Model{Id: s.Id}
  112. }
  113. model.AppId = s.AppId
  114. model.RuleId = s.RuleId
  115. model.ExceptionName = s.ExceptionName
  116. model.RecordTime = s.RecordTime
  117. model.AppendTime = s.AppendTime
  118. model.Uid = s.Uid
  119. model.AppName = s.AppName
  120. model.AppAlias = s.AppAlias
  121. model.RuleInfo = s.RuleInfo
  122. model.RowResult = s.RowResult
  123. model.RowsResult = s.RowsResult
  124. model.AlertStatus = s.AlertStatus
  125. model.IsKnow = s.IsKnow
  126. model.IsResolve = s.IsResolve
  127. model.IsIgnore = s.IsIgnore
  128. model.UpdateBy = s.UpdateBy // 添加这而,需要记录是被谁更新的
  129. }
  130. func (s *OtFireEventsUpdateReq) GetId() interface{} {
  131. return s.Id
  132. }
  133. // OtFireEventsGetReq 功能获取请求参数
  134. type OtFireEventsGetReq struct {
  135. Id int `uri:"id"`
  136. }
  137. func (s *OtFireEventsGetReq) GetId() interface{} {
  138. return s.Id
  139. }
  140. // OtFireEventsDeleteReq 功能删除请求参数
  141. type OtFireEventsDeleteReq struct {
  142. Ids []int `json:"ids"`
  143. }
  144. func (s *OtFireEventsDeleteReq) GetId() interface{} {
  145. return s.Ids
  146. }