model_groups.go 371 B

123456789101112
  1. package model
  2. // GetModelEnableGroups 返回指定模型名称可用的用户分组列表。
  3. // 复用缓存的定价映射,避免额外的数据库查询。
  4. func GetModelEnableGroups(modelName string) []string {
  5. for _, p := range GetPricing() {
  6. if p.ModelName == modelName {
  7. return p.EnableGroup
  8. }
  9. }
  10. return make([]string, 0)
  11. }