package model import ( "time" "gorm.io/datatypes" "gorm.io/gorm" ) // CarrierPollingParam 运营商账户调度参数;未配置的账户没有记录,使用全局默认。 type CarrierPollingParam struct { ID uint `gorm:"column:id;primaryKey" json:"id"` CarrierID uint `gorm:"column:carrier_id;not null" json:"carrier_id"` InflightLimit *int `gorm:"column:inflight_limit" json:"inflight_limit"` CardMaxInFlight *int `gorm:"column:card_max_in_flight" json:"card_max_in_flight"` StopResumeMaxInFlight *int `gorm:"column:stop_resume_max_in_flight" json:"stop_resume_max_in_flight"` SRInflightLimit *int `gorm:"column:sr_inflight_limit" json:"sr_inflight_limit"` PriorityMaxRatio *float64 `gorm:"column:priority_max_ratio" json:"priority_max_ratio"` StopResumeMinInterval *int `gorm:"column:stop_resume_min_interval" json:"stop_resume_min_interval"` StopResumeConfirmDelay *int `gorm:"column:stop_resume_confirm_delay" json:"stop_resume_confirm_delay"` Creator uint `gorm:"column:creator;not null;default:0" json:"creator"` Updater uint `gorm:"column:updater;not null;default:0" json:"updater"` CreatedAt time.Time `gorm:"column:created_at" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"` DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index" json:"-"` } // TableName 返回运营商账户调度参数表名。 func (CarrierPollingParam) TableName() string { return "tb_carrier_polling_param" } // PollingCheckScene 业务事件与读入口请求检查场景;场景由代码预置,后台只可修改检查类型、确认延迟与冷却。 type PollingCheckScene struct { ID uint `gorm:"column:id;primaryKey" json:"id"` Scene string `gorm:"column:scene;type:varchar(50);not null" json:"scene"` SceneName string `gorm:"column:scene_name;type:varchar(100);not null" json:"scene_name"` CheckTypes datatypes.JSON `gorm:"column:check_types;type:jsonb;not null" json:"check_types"` ConfirmDelays datatypes.JSON `gorm:"column:confirm_delays;type:jsonb;not null" json:"confirm_delays"` Cooldown *int `gorm:"column:cooldown" json:"cooldown"` Updater uint `gorm:"column:updater;not null;default:0" json:"updater"` CreatedAt time.Time `gorm:"column:created_at" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"` } // TableName 返回请求检查场景表名。 func (PollingCheckScene) TableName() string { return "tb_polling_check_scene" } // PollingFailureAlert 卡轮询失败告警;同一卡同一检查类型只保留一条未处理告警。 type PollingFailureAlert struct { ID uint `gorm:"column:id;primaryKey" json:"id"` AlertLevel string `gorm:"column:alert_level;type:varchar(20);not null;default:card" json:"alert_level"` CardID uint `gorm:"column:card_id;not null;default:0" json:"card_id"` ICCID string `gorm:"column:iccid;type:varchar(30);not null;default:''" json:"iccid"` CarrierID uint `gorm:"column:carrier_id;not null;default:0" json:"carrier_id"` CheckType string `gorm:"column:check_type;type:varchar(30);not null" json:"check_type"` ErrorCategory string `gorm:"column:error_category;type:varchar(50);not null;default:''" json:"error_category"` FailCount int `gorm:"column:fail_count;not null;default:0" json:"fail_count"` FirstFailedAt *time.Time `gorm:"column:first_failed_at" json:"first_failed_at"` LastFailedAt *time.Time `gorm:"column:last_failed_at" json:"last_failed_at"` LastError string `gorm:"column:last_error;type:varchar(500);not null;default:''" json:"last_error"` Status int `gorm:"column:status;type:smallint;not null;default:1" json:"status"` HandledBy uint `gorm:"column:handled_by;not null;default:0" json:"handled_by"` HandledAt *time.Time `gorm:"column:handled_at" json:"handled_at"` HandleRemark string `gorm:"column:handle_remark;type:varchar(500);not null;default:''" json:"handle_remark"` RecoveredAt *time.Time `gorm:"column:recovered_at" json:"recovered_at"` CreatedAt time.Time `gorm:"column:created_at" json:"created_at"` UpdatedAt time.Time `gorm:"column:updated_at" json:"updated_at"` } // TableName 返回卡轮询失败告警表名。 func (PollingFailureAlert) TableName() string { return "tb_polling_failure_alert" }