Files
EdgeAPI/internal/db/models/user_plan_stat_model.go

42 lines
2.2 KiB
Go
Raw Permalink Normal View History

2023-09-06 16:30:47 +08:00
package models
import "github.com/iwind/TeaGo/dbs"
const (
2023-12-19 14:56:44 +08:00
UserPlanStatField_Id dbs.FieldName = "id" // ID
UserPlanStatField_UserPlanId dbs.FieldName = "userPlanId" // 用户套餐ID
UserPlanStatField_Date dbs.FieldName = "date" // 日期YYYYMMDD或YYYYMM
UserPlanStatField_DateType dbs.FieldName = "dateType" // 日期类型day|month
UserPlanStatField_TrafficBytes dbs.FieldName = "trafficBytes" // 流量
UserPlanStatField_CountRequests dbs.FieldName = "countRequests" // 总请求数
UserPlanStatField_CountWebsocketConnections dbs.FieldName = "countWebsocketConnections" // Websocket连接数
UserPlanStatField_IsProcessed dbs.FieldName = "isProcessed" // 是否已处理
2023-09-06 16:30:47 +08:00
)
// UserPlanStat 用户套餐统计
type UserPlanStat struct {
2023-12-19 14:56:44 +08:00
Id uint64 `field:"id"` // ID
UserPlanId uint64 `field:"userPlanId"` // 用户套餐ID
Date string `field:"date"` // 日期YYYYMMDD或YYYYMM
DateType string `field:"dateType"` // 日期类型day|month
TrafficBytes uint64 `field:"trafficBytes"` // 流量
CountRequests uint64 `field:"countRequests"` // 总请求数
CountWebsocketConnections uint64 `field:"countWebsocketConnections"` // Websocket连接数
IsProcessed bool `field:"isProcessed"` // 是否已处理
2023-09-06 16:30:47 +08:00
}
type UserPlanStatOperator struct {
2023-12-19 14:56:44 +08:00
Id any // ID
UserPlanId any // 用户套餐ID
Date any // 日期YYYYMMDD或YYYYMM
DateType any // 日期类型day|month
TrafficBytes any // 流量
CountRequests any // 总请求数
CountWebsocketConnections any // Websocket连接数
IsProcessed any // 是否已处理
2023-09-06 16:30:47 +08:00
}
func NewUserPlanStatOperator() *UserPlanStatOperator {
return &UserPlanStatOperator{}
}