94 lines
2.5 KiB
Go
94 lines
2.5 KiB
Go
package model
|
|
|
|
import "time"
|
|
|
|
// TrafficUsageBase 是日流量和月流量共用的业务字段。
|
|
// 这些字段会分别写入 TDengine 的普通列和标签列。
|
|
type TrafficUsageBase struct {
|
|
Iccid string
|
|
UsageMb float64
|
|
PackageCode string
|
|
}
|
|
|
|
// TrafficUsageDailyItem 表示某张卡某一天的流量用量。
|
|
// Date 会被归一化到当天 00:00:00 作为 TDengine 主时间戳。
|
|
type TrafficUsageDailyItem struct {
|
|
TrafficUsageBase
|
|
Date time.Time
|
|
}
|
|
|
|
// TrafficUsageMonthlyItem 表示某张卡某个月的流量用量。
|
|
// Month 会被归一化到当月 1 日 00:00:00 作为 TDengine 主时间戳。
|
|
type TrafficUsageMonthlyItem struct {
|
|
TrafficUsageBase
|
|
Month time.Time
|
|
}
|
|
|
|
// TrafficPoolUsageItem 表示某张流量池某一天的流量用量。
|
|
type TrafficPoolUsageItem struct {
|
|
FlowPoolCode string
|
|
UsageMb float64
|
|
Date time.Time
|
|
}
|
|
|
|
// TrafficPoolCardCountItem 表示某张流量池某一天的卡数。
|
|
type TrafficPoolCardCountItem struct {
|
|
FlowPoolCode string
|
|
CardCount int64
|
|
Date time.Time
|
|
}
|
|
|
|
// TrafficPoolCard 表示某张流量池某一天的一张卡。
|
|
type TrafficPoolCard struct {
|
|
Iccid string
|
|
FlowPoolCode string
|
|
}
|
|
|
|
// TrafficPoolUsageAggregate 表示某张流量池某一天的流量用量和卡数。
|
|
type TrafficPoolUsageAggregate struct {
|
|
FlowPoolCode string
|
|
UsageMb float64
|
|
RecordCount int64
|
|
}
|
|
|
|
// TrafficUsageQueryInput 是按 ICCID 和时间范围查询流量数据的入参。
|
|
type TrafficUsageQueryInput struct {
|
|
Iccid string
|
|
StartTime time.Time
|
|
EndTime time.Time
|
|
Page int
|
|
PageSize int
|
|
Asc bool
|
|
}
|
|
|
|
// TrafficUsageDeleteInput 是按 ICCID 和时间范围删除流量数据的入参。
|
|
// 删除必须带时间范围,避免误删整张子表数据。
|
|
type TrafficUsageDeleteInput struct {
|
|
Iccid string
|
|
StartTime time.Time
|
|
EndTime time.Time
|
|
}
|
|
|
|
// TrafficUsageDailyRecord 是日流量查询结果。
|
|
type TrafficUsageDailyRecord struct {
|
|
Ts time.Time `json:"ts"`
|
|
UsageMb float64 `json:"usageMb"`
|
|
PackageCode string `json:"packageCode"`
|
|
Iccid string `json:"iccid"`
|
|
}
|
|
|
|
// TrafficUsageMonthlyRecord 是月流量查询结果。
|
|
type TrafficUsageMonthlyRecord struct {
|
|
Ts time.Time `json:"ts"`
|
|
UsageMb float64 `json:"usageMb"`
|
|
PackageCode string `json:"packageCode"`
|
|
Iccid string `json:"iccid"`
|
|
}
|
|
|
|
// TopUsageCard 是流量使用排名前五的卡片。
|
|
type TopUsageCard struct {
|
|
Iccid string `json:"iccid"`
|
|
UsageMb float64 `json:"usageMb"`
|
|
StatDate string `json:"statDate"`
|
|
}
|