chore: move sql code of UserSetting into Driver (#2282)

* Move SQL code of UserSetting into Driver

* Fix golang import issue
This commit is contained in:
Athurg Gooth
2023-09-26 19:02:48 +08:00
committed by GitHub
parent fcba3ffa26
commit 14ec524805
3 changed files with 171 additions and 120 deletions

View File

@@ -1,6 +1,10 @@
package store
import "context"
import (
"context"
storepb "github.com/usememos/memos/proto/gen/store"
)
type Driver interface {
CreateActivity(ctx context.Context, create *Activity) (*Activity, error)
@@ -12,4 +16,9 @@ type Driver interface {
UpdateUser(ctx context.Context, update *UpdateUser) (*User, error)
ListUsers(ctx context.Context, find *FindUser) ([]*User, error)
DeleteUser(ctx context.Context, delete *DeleteUser) error
UpsertUserSetting(ctx context.Context, upsert *UserSetting) (*UserSetting, error)
ListUserSettings(ctx context.Context, find *FindUserSetting) ([]*UserSetting, error)
UpsertUserSettingV1(ctx context.Context, upsert *storepb.UserSetting) (*storepb.UserSetting, error)
ListUserSettingsV1(ctx context.Context, find *FindUserSettingV1) ([]*storepb.UserSetting, error)
}