mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-04-19 06:37:28 +00:00
refactor(group): update user group handling to utilize userUsableGroups directly and add GetUserGroupRatio function
This commit is contained in:
@@ -52,3 +52,14 @@ func GetUserAutoGroup(userGroup string) []string {
|
||||
}
|
||||
return autoGroups
|
||||
}
|
||||
|
||||
// GetUserGroupRatio 获取用户使用某个分组的倍率
|
||||
// userGroup 用户分组
|
||||
// group 需要获取倍率的分组
|
||||
func GetUserGroupRatio(userGroup, group string) float64 {
|
||||
ratio, ok := ratio_setting.GetGroupGroupRatio(userGroup, group)
|
||||
if ok {
|
||||
return ratio
|
||||
}
|
||||
return ratio_setting.GetGroupRatio(group)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user