Files
EdgeCommon/pkg/serverconfigs/traffic_limit_status.go

20 lines
598 B
Go
Raw Normal View History

// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package serverconfigs
import timeutil "github.com/iwind/TeaGo/utils/time"
2021-11-09 17:36:34 +08:00
// TrafficLimitStatus 流量限制状态
type TrafficLimitStatus struct {
UntilDay string `yaml:"untilDay" json:"untilDay"` // 有效日期格式YYYYMMDD
2023-09-06 16:31:14 +08:00
PlanId int64 `yaml:"planId" json:"planId"` // 套餐ID
DateType string `yaml:"dateType" json:"dateType"` // 日期类型 day|month
}
2021-11-09 17:36:34 +08:00
func (this *TrafficLimitStatus) IsValid() bool {
if len(this.UntilDay) == 0 {
return false
}
return this.UntilDay >= timeutil.Format("Ymd")
}