package domain import ( "go.mongodb.org/mongo-driver/bson/primitive" ) type ShutdownStatisticsStatus string // 'error' | 'complete' // ShutdownStatisticsStatus枚举 const ( ShutdownStatisticsError ShutdownStatisticsStatus = "error" ShutdownStatisticsComplete ShutdownStatisticsStatus = "complete" ) type TaskShutdownStatistics struct { Id primitive.ObjectID `bson:"_id" json:"id"` Date string `bson:"date" json:"date"` } type ShutdownStatisticsItem struct { Id *primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` Date string `bson:"date" json:"date"` Status ShutdownStatisticsStatus `bson:"status" json:"status"` Count ShutdownStatisticsArea[uint] `bson:"count" json:"count"` // Country string `bson:"country" json:"country"` // 国家 SiteMap map[string]ShutdownStatisticsInfo `bson:"siteMap" json:"siteMap"` // SN: Info } type ShutdownStatisticsInfo struct { SiteAnalysisId *primitive.ObjectID `bson:"siteAnalysisId" json:"siteAnalysisId"` ShutdownTimeList []ShutdownTimePointInfo `bson:"shutdownTimeList" json:"shutdownTimeList"` } type ShutdownTimePointInfo struct { Time string `bson:"time" json:"time"` Type int `bson:"type" json:"type"` // 1-系统停机 2-aPower停机 } type ShutdownStatisticsDashboard struct { Date string `bson:"date" json:"date"` Weekly ShutdownStatisticsArea[[7]uint] `bson:"weekly" json:"weekly"` Yearly ShutdownStatisticsArea[[12]uint] `bson:"yearly" json:"yearly"` } type ShutdownStatisticsArea[T any] struct { ALL T `bson:"all" json:"all"` US T `bson:"us" json:"us"` AU T `bson:"au" json:"au"` }