chore: add memo visibility with user setting

This commit is contained in:
Steven
2022-08-19 00:00:47 +08:00
parent 43a8b7d0e1
commit ce390f3f79
3 changed files with 51 additions and 4 deletions

View File

@ -3,8 +3,10 @@ package api
type UserSettingKey string
const (
// UserSettingLocaleKey is the key type for user locale
// UserSettingLocaleKey is the key type for user locale.
UserSettingLocaleKey UserSettingKey = "locale"
// UserSettingMemoVisibilityKey is the key type for user perference memo default visibility.
UserSettingMemoVisibilityKey UserSettingKey = "memo-visibility"
)
// String returns the string format of UserSettingKey type.
@ -12,6 +14,8 @@ func (key UserSettingKey) String() string {
switch key {
case UserSettingLocaleKey:
return "locale"
case UserSettingMemoVisibilityKey:
return "memo-visibility"
}
return ""
}
@ -31,4 +35,6 @@ type UserSettingUpsert struct {
type UserSettingFind struct {
UserID int
Key *UserSettingKey `json:"key"`
}