refactor(setting): remove SynableStore interface and related logic

* Eliminated the `SynableStore` interface from `SettingStore` to simplify the architecture.
* Removed the unused `syncStore` field from `SettingValue` struct and its related logic in the `Set` method.
* This change enhances code clarity and maintainability by reducing complexity.
This commit is contained in:
qianlifeng 2025-07-18 22:23:18 +08:00
parent 5be879167f
commit 974010a6da
No known key found for this signature in database
3 changed files with 0 additions and 10 deletions

View File

@ -20,10 +20,6 @@ type SettingStore interface {
Delete(key string) error
}
type SynableStore interface {
LogOplog(key string, value interface{}) error
}
type WoxSettingStore struct {
db *gorm.DB
}

View File

@ -17,7 +17,6 @@ type SettingValue[T any] struct {
defaultValue T
settingStore SettingStore
syncStore SynableStore
validator ValidatorFunc[T]
syncable bool
isLoaded bool
@ -170,10 +169,5 @@ func (v *SettingValue[T]) Set(newValue T) error {
v.value = newValue
v.isLoaded = true
if v.syncable {
return v.syncStore.LogOplog(v.key, newValue)
}
return nil
}

Binary file not shown.