(group int)
| 112 | } |
| 113 | |
| 114 | func GetSettingItemsByGroup(group int) ([]model.SettingItem, error) { |
| 115 | key := fmt.Sprintf("GROUP_%d", group) |
| 116 | if items, exists := Cache.GetSettingGroup(key); exists { |
| 117 | return items, nil |
| 118 | } |
| 119 | items, err, _ := settingGroupG.Do(key, func() ([]model.SettingItem, error) { |
| 120 | _items, err := db.GetSettingItemsByGroup(group) |
| 121 | if err != nil { |
| 122 | return nil, err |
| 123 | } |
| 124 | settingGroupCacheF(key, _items) |
| 125 | return _items, nil |
| 126 | }) |
| 127 | return items, err |
| 128 | } |
| 129 | |
| 130 | func GetSettingItemsInGroups(groups []int) ([]model.SettingItem, error) { |
| 131 | sort.Ints(groups) |
nothing calls this directly
no test coverage detected