增加账单、套餐相关配置

This commit is contained in:
GoEdgeLab
2021-11-11 08:31:32 +08:00
parent 79da524d88
commit 3d8d2438bc
7 changed files with 57 additions and 6 deletions

View File

@@ -53,6 +53,8 @@ type ServerConfig struct {
Group *ServerGroupConfig `yaml:"group" json:"group"`
isOk bool
planId int64
}
// NewServerConfigFromJSON 从JSON中解析Server配置
@@ -230,6 +232,10 @@ func (this *ServerConfig) Init() error {
if err != nil {
return err
}
if this.UserPlan.Plan != nil {
this.planId = this.UserPlan.Plan.Id
}
}
this.isOk = true
@@ -368,3 +374,8 @@ func (this *ServerConfig) FindAndCheckReverseProxy(dataType string) (*ReversePro
func (this *ServerConfig) ShouldCheckTrafficLimit() bool {
return this.TrafficLimit != nil && !this.TrafficLimit.IsEmpty()
}
// PlanId 套餐ID
func (this *ServerConfig) PlanId() int64 {
return this.planId
}