Bind the linuxdo trust_level to the user group.

This commit is contained in:
icpd
2024-03-16 04:39:40 +08:00
parent 9adefa80b9
commit 1802953e68
6 changed files with 123 additions and 61 deletions

View File

@@ -3,9 +3,11 @@ package common
import "encoding/json"
var GroupRatio = map[string]float64{
"default": 1,
"vip": 1,
"svip": 1,
LinuxDoTrustLevel0: 1,
LinuxDoTrustLevel1: 1,
LinuxDoTrustLevel2: 1,
LinuxDoTrustLevel3: 1,
LinuxDoTrustLevel4: 1,
}
func GroupRatio2JSONString() string {

17
common/linuxdo-group.go Normal file
View File

@@ -0,0 +1,17 @@
package common
import "fmt"
const (
LinuxDoTrustLevel0 = "Level0"
LinuxDoTrustLevel1 = "level1"
LinuxDoTrustLevel2 = "level2"
LinuxDoTrustLevel3 = "level3"
LinuxDoTrustLevel4 = "level4"
)
type TrustLevel int
func (l TrustLevel) String() string {
return fmt.Sprintf("level%d", l)
}

View File

@@ -3,9 +3,11 @@ package common
import "encoding/json"
var TopupGroupRatio = map[string]float64{
"default": 1,
"vip": 1,
"svip": 1,
LinuxDoTrustLevel0: 1,
LinuxDoTrustLevel1: 1,
LinuxDoTrustLevel2: 1,
LinuxDoTrustLevel3: 1,
LinuxDoTrustLevel4: 1,
}
func TopupGroupRatio2JSONString() string {