123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- package dto
- import (
- "go-admin/app/admin/models"
- "go-admin/common/dto"
- common "go-admin/common/models"
- )
- type OtAlertPolicyGetPageReq struct {
- dto.Pagination `search:"-"`
- AppId int64 `form:"appId" search:"type:exact;column:app_id;table:ot_alert_policy" comment:"业务ID"`
- RuleId int64 `form:"ruleId" search:"type:exact;column:rule_id;table:ot_alert_policy" comment:"监控规则ID"`
- MonitorAlias string `form:"monitorAlias" search:"type:exact;column:monitor_alias;table:ot_alert_policy" comment:"监控项别名"`
- Power string `form:"power" search:"type:exact;column:power;table:ot_alert_policy" comment:"是否启用"`
- OtAlertPolicyOrder
- }
- type OtAlertPolicyImportReq struct {
- AppId int64 `json:"appId" search:"type:or;column:app_id;table:ot_alert_policy" comment:"业务ID"`
- // OtAlertPolicyOrder
- }
- type OtAlertPolicyOrder struct {
- Id string `form:"idOrder" search:"type:order;column:id;table:ot_alert_policy"`
- AppId string `form:"appIdOrder" search:"type:order;column:app_id;table:ot_alert_policy"`
- RuleId string `form:"ruleIdOrder" search:"type:order;column:rule_id;table:ot_alert_policy"`
- MonitorAlias string `form:"monitorAliasOrder" search:"type:order;column:monitor_alias;table:ot_alert_policy"`
- Policy string `form:"policyOrder" search:"type:order;column:policy;table:ot_alert_policy"`
- Power string `form:"powerOrder" search:"type:order;column:power;table:ot_alert_policy"`
- CreatedAt string `form:"createdAtOrder" search:"type:order;column:created_at;table:ot_alert_policy"`
- UpdatedAt string `form:"updatedAtOrder" search:"type:order;column:updated_at;table:ot_alert_policy"`
- DeletedAt string `form:"deletedAtOrder" search:"type:order;column:deleted_at;table:ot_alert_policy"`
- CreateBy string `form:"createByOrder" search:"type:order;column:create_by;table:ot_alert_policy"`
- UpdateBy string `form:"updateByOrder" search:"type:order;column:update_by;table:ot_alert_policy"`
- }
- func (m *OtAlertPolicyGetPageReq) GetNeedSearch() interface{} {
- return *m
- }
- type OtAlertPolicyInsertReq struct {
- Id int `json:"-" comment:"业务应用告警规则表"` // 业务应用告警规则表
- AppId int64 `json:"appId" comment:"业务ID"`
- RuleId int64 `json:"ruleId" comment:"监控规则ID"`
- MonitorAlias string `json:"monitorAlias" comment:"监控项别名"`
- Policy string `json:"policy" comment:"告警策略"`
- Power int64 `json:"power" comment:"是否启用"`
- common.ControlBy
- }
- func (s *OtAlertPolicyInsertReq) Generate(model *models.OtAlertPolicy) {
- if s.Id == 0 {
- model.Model = common.Model{Id: s.Id}
- }
- model.AppId = s.AppId
- model.RuleId = s.RuleId
- model.MonitorAlias = s.MonitorAlias
- model.Policy = s.Policy
- model.Power = s.Power
- model.CreateBy = s.CreateBy // 添加这而,需要记录是被谁创建的
- }
- func (s *OtAlertPolicyInsertReq) GetId() interface{} {
- return s.Id
- }
- type OtAlertPolicyUpdateReq struct {
- Id int `uri:"id" comment:"业务应用告警规则表"` // 业务应用告警规则表
- AppId int64 `json:"appId" comment:"业务ID"`
- RuleId int64 `json:"ruleId" comment:"监控规则ID"`
- MonitorAlias string `json:"monitorAlias" comment:"监控项别名"`
- Policy string `json:"policy" comment:"告警策略"`
- Power int64 `json:"power" comment:"是否启用"`
- common.ControlBy
- }
- func (s *OtAlertPolicyUpdateReq) Generate(model *models.OtAlertPolicy) {
- if s.Id == 0 {
- model.Model = common.Model{Id: s.Id}
- }
- model.AppId = s.AppId
- model.RuleId = s.RuleId
- model.MonitorAlias = s.MonitorAlias
- model.Policy = s.Policy
- model.Power = s.Power
- model.UpdateBy = s.UpdateBy // 添加这而,需要记录是被谁更新的
- }
- func (s *OtAlertPolicyUpdateReq) GetId() interface{} {
- return s.Id
- }
- // OtAlertPolicyGetReq 功能获取请求参数
- type OtAlertPolicyGetReq struct {
- Id int `uri:"id"`
- }
- func (s *OtAlertPolicyGetReq) GetId() interface{} {
- return s.Id
- }
- // OtAlertPolicyDeleteReq 功能删除请求参数
- type OtAlertPolicyDeleteReq struct {
- Ids []int `json:"ids"`
- }
- func (s *OtAlertPolicyDeleteReq) GetId() interface{} {
- return s.Ids
- }
|