mirror of
https://github.com/usememos/memos.git
synced 2025-01-07 04:40:30 +08:00
90b881502d
* feat: add `user_setting` model * chore: add global store * chore: update settings in web * chore: update `i18n` example
34 lines
653 B
Go
34 lines
653 B
Go
package api
|
|
|
|
type UserSettingKey string
|
|
|
|
const (
|
|
// UserSettingLocaleKey is the key type for user locale
|
|
UserSettingLocaleKey UserSettingKey = "locale"
|
|
)
|
|
|
|
// String returns the string format of UserSettingKey type.
|
|
func (key UserSettingKey) String() string {
|
|
switch key {
|
|
case UserSettingLocaleKey:
|
|
return "locale"
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type UserSetting struct {
|
|
UserID int
|
|
Key UserSettingKey `json:"key"`
|
|
// Value is a JSON string with basic value
|
|
Value string `json:"value"`
|
|
}
|
|
|
|
type UserSettingUpsert struct {
|
|
UserID int
|
|
Key UserSettingKey `json:"key"`
|
|
Value string `json:"value"`
|
|
}
|
|
|
|
type UserSettingFind struct {
|
|
UserID int
|
|
}
|