MCPcopy Create free account
hub / github.com/astercloud/aster / findExistingPreference

Method findExistingPreference

pkg/memory/preference.go:143–155  ·  view source on GitHub ↗

findExistingPreference 查找已存在的偏好

(
	userID string,
	category PreferenceCategory,
	key string,
)

Source from the content-addressed store, hash-verified

141
142// findExistingPreference 查找已存在的偏好
143func (pm *PreferenceManager) findExistingPreference(
144 userID string,
145 category PreferenceCategory,
146 key string,
147) *Preference {
148 prefs := pm.preferences[userID]
149 for _, p := range prefs {
150 if p.Category == category && p.Key == key {
151 return p
152 }
153 }
154 return nil
155}
156
157// handleConflict 处理偏好冲突
158func (pm *PreferenceManager) handleConflict(existing, new *Preference) error {

Callers 3

AddPreferenceMethod · 0.95
GetPreferenceMethod · 0.95
UpdatePreferenceMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected