mirror of
https://github.com/linux-do/new-api.git
synced 2025-12-25 08:05:56 +08:00
完善个人中心
This commit is contained in:
@@ -13,6 +13,16 @@ type Ability struct {
|
||||
Priority *int64 `json:"priority" gorm:"bigint;default:0;index"`
|
||||
}
|
||||
|
||||
func GetGroupModels(group string) []string {
|
||||
var abilities []Ability
|
||||
DB.Where("`group` = ?", group).Find(&abilities)
|
||||
models := make([]string, 0, len(abilities))
|
||||
for _, ability := range abilities {
|
||||
models = append(models, ability.Model)
|
||||
}
|
||||
return models
|
||||
}
|
||||
|
||||
func GetRandomSatisfiedChannel(group string, model string) (*Channel, error) {
|
||||
ability := Ability{}
|
||||
groupCol := "`group`"
|
||||
|
||||
Reference in New Issue
Block a user