refactor(group): update user group handling to utilize userUsableGroups directly and add GetUserGroupRatio function

This commit is contained in:
CaIon
2025-10-30 21:16:42 +08:00
parent f1ac5606ee
commit 52d9b8cc78
4 changed files with 15 additions and 3 deletions

View File

@@ -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)
}