mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2026-02-08 22:45:38 +08:00
增加账单、套餐相关配置
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user