12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- package dto
- import (
- "go-admin/app/observe/models"
- "go-admin/common/dto"
- "strings"
- )
- type EventListReq struct {
- AppId int64 `form:"app_id"`
- AlertStatus int64 `form:"alert_status"`
- ExceptionName string `form:"exception_name"`
- models.TimeRange
- dto.Pagination
- }
- type EventListResp struct {
- models.Events
- }
- // func (*EventListReq) Messages() request.ValidatorMessages {
- // return request.ValidatorMessages{
- // "AppId.required": "app_id不能为空",
- // }
- // }
- type EventExceptionNumsReq struct {
- AppIds string `form:"app_ids"`
- AppAliases string `form:"app_aliases"`
- models.TimeRange
- dto.Pagination
- }
- func (r *EventExceptionNumsReq) GetAppIds() []string {
- return strings.Split(r.AppIds, ",")
- }
- func (r *EventExceptionNumsReq) GetAppAliases() []string {
- return strings.Split(r.AppAliases, ",")
- }
- type EventExceptionNumsResp struct {
- AppId int64 `json:"app_id"`
- AppAlias string `json:"app_alias"`
- AppName string `json:"app_name"`
- ExceptionNum int64 `json:"exception_num"`
- }
- type EventExecptionNumGetByIDReq struct {
- Id int `uri:"id"`
- }
- // EventStatisticReq TODO:暂时基于otel status_code来进行异常事件判断,会漏掉很大一部分异常,需优化
- type EventStatisticReq struct {
- Kind string `form:"kind"` //异常筛选维度:app、biz、service、interface
- AppAlias string `form:"app_alias"`
- SubconditionValue string `form:"subcondition_value"` //子选项的值,例如kind为service,该值为 checkout_service,服务的英文原名
- BizHash string `form:"biz_hash"` // 当异常筛选维度为biz时,该字段必传
- models.TimeRange
- }
- type EventStatisticResp struct {
- Total int64 `json:"total"`
- StartTime string `json:"start_time"`
- // StatusMessage string `json:"status_message,omitempty"`
- }
- // type EventListReq struct {
- // Kind string `from:"kind"` //异常筛选维度:app、biz、service、interface
- // AppAlias string `form:"app_alias"`
- // SubconditionValue string `form:"subcondition_value"` //子选项的值,例如kind为service,该值为 checkout_service,服务的英文原名
- // models.TimeRange
- // }
- type EventListsResp struct {
- StatusMessageCount int64 `json:"total"`
- ErrorType string `json:"error_type"`
- StatusMessage1 string `json:"status_message"`
- ServiceId int64 `json:"service_id"`
- ServiceName string `json:"service_name"`
- ServiceNameCN string `json:"service_name_cn"`
- }
|