package dto import ( "go-admin/app/admin/models" "go-admin/common/dto" common "go-admin/common/models" ) type OtMonitorRulesGetPageReq struct { dto.Pagination `search:"-"` Kind string `form:"kind" search:"type:exact;column:kind;table:ot_monitor_rules" comment:"所属分类:trace,metric,log"` Group string `form:"group" search:"type:exact;column:group;table:ot_monitor_rules" comment:"子类型,聚类筛选,可自添加"` Name string `form:"name" search:"type:exact;column:name;table:ot_monitor_rules" comment:"事件项名称,不可重复"` MonitorAlias string `form:"monitorAlias" search:"type:exact;column:monitor_alias;table:ot_monitor_rules" comment:"监控项别名"` DataSource string `form:"dataSource" search:"type:exact;column:data_source;table:ot_monitor_rules" comment:"数据源"` Verify int64 `form:"verify" search:"type:exact;column:verify;table:ot_monitor_rules" comment:"是否验证成功"` Power int64 `form:"power" search:"type:exact;column:power;table:ot_monitor_rules" comment:"是否启用"` AppID int64 `form:"appId" search:"type:or;column:app_id;table:ap"` OtMonitorRulesOrder } type OtMonitorRulesOrder struct { Id string `form:"idOrder" search:"type:order;column:id;table:ot_monitor_rules"` Kind string `form:"kindOrder" search:"type:order;column:kind;table:ot_monitor_rules"` Group string `form:"groupOrder" search:"type:order;column:group;table:ot_monitor_rules"` Name string `form:"nameOrder" search:"type:order;column:name;table:ot_monitor_rules"` MonitorAlias string `form:"monitorAliasOrder" search:"type:order;column:monitor_alias;table:ot_monitor_rules"` DataSource string `form:"dataSourceOrder" search:"type:order;column:data_source;table:ot_monitor_rules"` Table string `form:"tableOrder" search:"type:order;column:table;table:ot_monitor_rules"` ValueType string `form:"valueTypeOrder" search:"type:order;column:value_type;table:ot_monitor_rules"` Expression string `form:"expressionOrder" search:"type:order;column:expression;table:ot_monitor_rules"` Interval string `form:"intervalOrder" search:"type:order;column:interval;table:ot_monitor_rules"` Verify string `form:"verifyOrder" search:"type:order;column:verify;table:ot_monitor_rules"` Power string `form:"powerOrder" search:"type:order;column:power;table:ot_monitor_rules"` CreatedAt string `form:"createdAtOrder" search:"type:order;column:created_at;table:ot_monitor_rules"` UpdatedAt string `form:"updatedAtOrder" search:"type:order;column:updated_at;table:ot_monitor_rules"` DeletedAt string `form:"deletedAtOrder" search:"type:order;column:deleted_at;table:ot_monitor_rules"` CreateBy string `form:"createByOrder" search:"type:order;column:create_by;table:ot_monitor_rules"` UpdateBy string `form:"updateByOrder" search:"type:order;column:update_by;table:ot_monitor_rules"` } func (m *OtMonitorRulesGetPageReq) GetNeedSearch() interface{} { return *m } type OtMonitorRulesInsertReq struct { Id int `json:"-" comment:"(链路)事件监控规则表"` // (链路)事件监控规则表 Kind string `json:"kind" comment:"所属分类:trace,metric,log"` Group string `json:"group" comment:"子类型,聚类筛选,可自添加"` Name string `json:"name" comment:"事件项名称,不可重复"` MonitorAlias string `json:"monitorAlias" comment:"监控项别名"` DataSource string `json:"dataSource" comment:"数据源"` Table string `json:"table" comment:"表名"` ValueType string `json:"valueType" comment:"值类型"` Expression string `json:"expression" comment:"表达式"` Interval int64 `json:"interval" comment:"探测周期"` Verify int64 `json:"verify" comment:"是否验证成功"` Power int64 `json:"power" comment:"是否启用"` common.ControlBy } func (s *OtMonitorRulesInsertReq) Generate(model *models.OtMonitorRules) { if s.Id == 0 { model.Model = common.Model{Id: s.Id} } model.Kind = s.Kind model.Group = s.Group model.Name = s.Name model.MonitorAlias = s.MonitorAlias model.DataSource = s.DataSource model.Table = s.Table model.ValueType = s.ValueType model.Expression = s.Expression model.Interval = s.Interval model.Verify = s.Verify model.Power = s.Power model.CreateBy = s.CreateBy // 添加这而,需要记录是被谁创建的 } func (s *OtMonitorRulesInsertReq) GetId() interface{} { return s.Id } type OtMonitorRulesUpdateReq struct { Id int `uri:"id" comment:"(链路)事件监控规则表"` // (链路)事件监控规则表 Kind string `json:"kind" comment:"所属分类:trace,metric,log"` Group string `json:"group" comment:"子类型,聚类筛选,可自添加"` Name string `json:"name" comment:"事件项名称,不可重复"` MonitorAlias string `json:"monitorAlias" comment:"监控项别名"` DataSource string `json:"dataSource" comment:"数据源"` Table string `json:"table" comment:"表名"` ValueType string `json:"valueType" comment:"值类型"` Expression string `json:"expression" comment:"表达式"` Interval int64 `json:"interval" comment:"探测周期"` Verify int64 `json:"verify" comment:"是否验证成功"` Power int64 `json:"power" comment:"是否启用"` common.ControlBy } func (s *OtMonitorRulesUpdateReq) Generate(model *models.OtMonitorRules) { if s.Id == 0 { model.Model = common.Model{Id: s.Id} } model.Kind = s.Kind model.Group = s.Group model.Name = s.Name model.MonitorAlias = s.MonitorAlias model.DataSource = s.DataSource model.Table = s.Table model.ValueType = s.ValueType model.Expression = s.Expression model.Interval = s.Interval model.Verify = s.Verify model.Power = s.Power model.UpdateBy = s.UpdateBy // 添加这而,需要记录是被谁更新的 } func (s *OtMonitorRulesUpdateReq) GetId() interface{} { return s.Id } // OtMonitorRulesGetReq 功能获取请求参数 type OtMonitorRulesGetReq struct { Id int `uri:"id"` } func (s *OtMonitorRulesGetReq) GetId() interface{} { return s.Id } // OtMonitorRulesDeleteReq 功能删除请求参数 type OtMonitorRulesDeleteReq struct { Ids []int `json:"ids"` } func (s *OtMonitorRulesDeleteReq) GetId() interface{} { return s.Ids }