From b50e80912512098f84d975e5bbdb50c426e693c9 Mon Sep 17 00:00:00 2001 From: steven Date: Tue, 5 Sep 2023 23:48:32 +0800 Subject: [PATCH] feat: add color theme user setting definition --- .../proto/api/v2/user_setting_service_pb.d.ts | 27 +++ .../proto/api/v2/user_setting_service_pb.js | 13 + .../types/proto/store/user_setting_pb.d.ts | 33 +++ .../src/types/proto/store/user_setting_pb.js | 14 ++ .../proto/api/v2/user_setting_service_pb.d.ts | 27 +++ .../proto/api/v2/user_setting_service_pb.js | 13 + .../types/proto/store/user_setting_pb.d.ts | 33 +++ .../src/types/proto/store/user_setting_pb.js | 14 ++ proto/api/v2/user_setting_service.proto | 8 + proto/gen/api/v2/README.md | 15 ++ proto/gen/api/v2/user_setting_service.pb.go | 224 ++++++++++++------ proto/gen/store/README.md | 16 ++ proto/gen/store/user_setting.pb.go | 187 +++++++++++---- proto/store/user_setting.proto | 10 + store/user_setting.go | 17 ++ test/store/user_setting_test.go | 22 ++ 16 files changed, 545 insertions(+), 128 deletions(-) diff --git a/frontend/extension/src/types/proto/api/v2/user_setting_service_pb.d.ts b/frontend/extension/src/types/proto/api/v2/user_setting_service_pb.d.ts index d9273f9..32e147a 100644 --- a/frontend/extension/src/types/proto/api/v2/user_setting_service_pb.d.ts +++ b/frontend/extension/src/types/proto/api/v2/user_setting_service_pb.d.ts @@ -24,6 +24,13 @@ export declare class UserSetting extends Message { */ locale: UserSetting_Locale; + /** + * color_theme is the user color theme. + * + * @generated from field: slash.api.v2.UserSetting.ColorTheme color_theme = 3; + */ + colorTheme: UserSetting_ColorTheme; + constructor(data?: PartialMessage); static readonly runtime: typeof proto3; @@ -59,6 +66,26 @@ export declare enum UserSetting_Locale { ZH = 2, } +/** + * @generated from enum slash.api.v2.UserSetting.ColorTheme + */ +export declare enum UserSetting_ColorTheme { + /** + * @generated from enum value: COLOR_THEME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: COLOR_THEME_LIGHT = 1; + */ + LIGHT = 1, + + /** + * @generated from enum value: COLOR_THEME_DARK = 2; + */ + DARK = 2, +} + /** * @generated from message slash.api.v2.GetUserSettingRequest */ diff --git a/frontend/extension/src/types/proto/api/v2/user_setting_service_pb.js b/frontend/extension/src/types/proto/api/v2/user_setting_service_pb.js index 6b27e1c..cd468d2 100644 --- a/frontend/extension/src/types/proto/api/v2/user_setting_service_pb.js +++ b/frontend/extension/src/types/proto/api/v2/user_setting_service_pb.js @@ -13,6 +13,7 @@ export const UserSetting = proto3.makeMessageType( () => [ { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, { no: 2, name: "locale", kind: "enum", T: proto3.getEnumType(UserSetting_Locale) }, + { no: 3, name: "color_theme", kind: "enum", T: proto3.getEnumType(UserSetting_ColorTheme) }, ], ); @@ -28,6 +29,18 @@ export const UserSetting_Locale = proto3.makeEnum( ], ); +/** + * @generated from enum slash.api.v2.UserSetting.ColorTheme + */ +export const UserSetting_ColorTheme = proto3.makeEnum( + "slash.api.v2.UserSetting.ColorTheme", + [ + {no: 0, name: "COLOR_THEME_UNSPECIFIED", localName: "UNSPECIFIED"}, + {no: 1, name: "COLOR_THEME_LIGHT", localName: "LIGHT"}, + {no: 2, name: "COLOR_THEME_DARK", localName: "DARK"}, + ], +); + /** * @generated from message slash.api.v2.GetUserSettingRequest */ diff --git a/frontend/extension/src/types/proto/store/user_setting_pb.d.ts b/frontend/extension/src/types/proto/store/user_setting_pb.d.ts index a44ab4d..d99dd2a 100644 --- a/frontend/extension/src/types/proto/store/user_setting_pb.d.ts +++ b/frontend/extension/src/types/proto/store/user_setting_pb.d.ts @@ -28,6 +28,13 @@ export declare enum UserSettingKey { * @generated from enum value: USER_SETTING_LOCALE = 2; */ USER_SETTING_LOCALE = 2, + + /** + * Color theme for the user. + * + * @generated from enum value: USER_SETTING_COLOR_THEME = 3; + */ + USER_SETTING_COLOR_THEME = 3, } /** @@ -50,6 +57,26 @@ export declare enum LocaleUserSetting { ZH = 2, } +/** + * @generated from enum slash.store.ColorThemeUserSetting + */ +export declare enum ColorThemeUserSetting { + /** + * @generated from enum value: COLOR_THEME_USER_SETTING_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: COLOR_THEME_USER_SETTING_LIGHT = 1; + */ + LIGHT = 1, + + /** + * @generated from enum value: COLOR_THEME_USER_SETTING_DARK = 2; + */ + DARK = 2, +} + /** * @generated from message slash.store.UserSetting */ @@ -79,6 +106,12 @@ export declare class UserSetting extends Message { */ value: LocaleUserSetting; case: "locale"; + } | { + /** + * @generated from field: slash.store.ColorThemeUserSetting color_theme = 5; + */ + value: ColorThemeUserSetting; + case: "colorTheme"; } | { case: undefined; value?: undefined }; constructor(data?: PartialMessage); diff --git a/frontend/extension/src/types/proto/store/user_setting_pb.js b/frontend/extension/src/types/proto/store/user_setting_pb.js index 4791ad6..94da2ac 100644 --- a/frontend/extension/src/types/proto/store/user_setting_pb.js +++ b/frontend/extension/src/types/proto/store/user_setting_pb.js @@ -14,6 +14,7 @@ export const UserSettingKey = proto3.makeEnum( {no: 0, name: "USER_SETTING_KEY_UNSPECIFIED"}, {no: 1, name: "USER_SETTING_ACCESS_TOKENS"}, {no: 2, name: "USER_SETTING_LOCALE"}, + {no: 3, name: "USER_SETTING_COLOR_THEME"}, ], ); @@ -29,6 +30,18 @@ export const LocaleUserSetting = proto3.makeEnum( ], ); +/** + * @generated from enum slash.store.ColorThemeUserSetting + */ +export const ColorThemeUserSetting = proto3.makeEnum( + "slash.store.ColorThemeUserSetting", + [ + {no: 0, name: "COLOR_THEME_USER_SETTING_UNSPECIFIED", localName: "UNSPECIFIED"}, + {no: 1, name: "COLOR_THEME_USER_SETTING_LIGHT", localName: "LIGHT"}, + {no: 2, name: "COLOR_THEME_USER_SETTING_DARK", localName: "DARK"}, + ], +); + /** * @generated from message slash.store.UserSetting */ @@ -39,6 +52,7 @@ export const UserSetting = proto3.makeMessageType( { no: 2, name: "key", kind: "enum", T: proto3.getEnumType(UserSettingKey) }, { no: 3, name: "access_tokens", kind: "message", T: AccessTokensUserSetting, oneof: "value" }, { no: 4, name: "locale", kind: "enum", T: proto3.getEnumType(LocaleUserSetting), oneof: "value" }, + { no: 5, name: "color_theme", kind: "enum", T: proto3.getEnumType(ColorThemeUserSetting), oneof: "value" }, ], ); diff --git a/frontend/web/src/types/proto/api/v2/user_setting_service_pb.d.ts b/frontend/web/src/types/proto/api/v2/user_setting_service_pb.d.ts index d9273f9..32e147a 100644 --- a/frontend/web/src/types/proto/api/v2/user_setting_service_pb.d.ts +++ b/frontend/web/src/types/proto/api/v2/user_setting_service_pb.d.ts @@ -24,6 +24,13 @@ export declare class UserSetting extends Message { */ locale: UserSetting_Locale; + /** + * color_theme is the user color theme. + * + * @generated from field: slash.api.v2.UserSetting.ColorTheme color_theme = 3; + */ + colorTheme: UserSetting_ColorTheme; + constructor(data?: PartialMessage); static readonly runtime: typeof proto3; @@ -59,6 +66,26 @@ export declare enum UserSetting_Locale { ZH = 2, } +/** + * @generated from enum slash.api.v2.UserSetting.ColorTheme + */ +export declare enum UserSetting_ColorTheme { + /** + * @generated from enum value: COLOR_THEME_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: COLOR_THEME_LIGHT = 1; + */ + LIGHT = 1, + + /** + * @generated from enum value: COLOR_THEME_DARK = 2; + */ + DARK = 2, +} + /** * @generated from message slash.api.v2.GetUserSettingRequest */ diff --git a/frontend/web/src/types/proto/api/v2/user_setting_service_pb.js b/frontend/web/src/types/proto/api/v2/user_setting_service_pb.js index 6b27e1c..cd468d2 100644 --- a/frontend/web/src/types/proto/api/v2/user_setting_service_pb.js +++ b/frontend/web/src/types/proto/api/v2/user_setting_service_pb.js @@ -13,6 +13,7 @@ export const UserSetting = proto3.makeMessageType( () => [ { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, { no: 2, name: "locale", kind: "enum", T: proto3.getEnumType(UserSetting_Locale) }, + { no: 3, name: "color_theme", kind: "enum", T: proto3.getEnumType(UserSetting_ColorTheme) }, ], ); @@ -28,6 +29,18 @@ export const UserSetting_Locale = proto3.makeEnum( ], ); +/** + * @generated from enum slash.api.v2.UserSetting.ColorTheme + */ +export const UserSetting_ColorTheme = proto3.makeEnum( + "slash.api.v2.UserSetting.ColorTheme", + [ + {no: 0, name: "COLOR_THEME_UNSPECIFIED", localName: "UNSPECIFIED"}, + {no: 1, name: "COLOR_THEME_LIGHT", localName: "LIGHT"}, + {no: 2, name: "COLOR_THEME_DARK", localName: "DARK"}, + ], +); + /** * @generated from message slash.api.v2.GetUserSettingRequest */ diff --git a/frontend/web/src/types/proto/store/user_setting_pb.d.ts b/frontend/web/src/types/proto/store/user_setting_pb.d.ts index a44ab4d..d99dd2a 100644 --- a/frontend/web/src/types/proto/store/user_setting_pb.d.ts +++ b/frontend/web/src/types/proto/store/user_setting_pb.d.ts @@ -28,6 +28,13 @@ export declare enum UserSettingKey { * @generated from enum value: USER_SETTING_LOCALE = 2; */ USER_SETTING_LOCALE = 2, + + /** + * Color theme for the user. + * + * @generated from enum value: USER_SETTING_COLOR_THEME = 3; + */ + USER_SETTING_COLOR_THEME = 3, } /** @@ -50,6 +57,26 @@ export declare enum LocaleUserSetting { ZH = 2, } +/** + * @generated from enum slash.store.ColorThemeUserSetting + */ +export declare enum ColorThemeUserSetting { + /** + * @generated from enum value: COLOR_THEME_USER_SETTING_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: COLOR_THEME_USER_SETTING_LIGHT = 1; + */ + LIGHT = 1, + + /** + * @generated from enum value: COLOR_THEME_USER_SETTING_DARK = 2; + */ + DARK = 2, +} + /** * @generated from message slash.store.UserSetting */ @@ -79,6 +106,12 @@ export declare class UserSetting extends Message { */ value: LocaleUserSetting; case: "locale"; + } | { + /** + * @generated from field: slash.store.ColorThemeUserSetting color_theme = 5; + */ + value: ColorThemeUserSetting; + case: "colorTheme"; } | { case: undefined; value?: undefined }; constructor(data?: PartialMessage); diff --git a/frontend/web/src/types/proto/store/user_setting_pb.js b/frontend/web/src/types/proto/store/user_setting_pb.js index 4791ad6..94da2ac 100644 --- a/frontend/web/src/types/proto/store/user_setting_pb.js +++ b/frontend/web/src/types/proto/store/user_setting_pb.js @@ -14,6 +14,7 @@ export const UserSettingKey = proto3.makeEnum( {no: 0, name: "USER_SETTING_KEY_UNSPECIFIED"}, {no: 1, name: "USER_SETTING_ACCESS_TOKENS"}, {no: 2, name: "USER_SETTING_LOCALE"}, + {no: 3, name: "USER_SETTING_COLOR_THEME"}, ], ); @@ -29,6 +30,18 @@ export const LocaleUserSetting = proto3.makeEnum( ], ); +/** + * @generated from enum slash.store.ColorThemeUserSetting + */ +export const ColorThemeUserSetting = proto3.makeEnum( + "slash.store.ColorThemeUserSetting", + [ + {no: 0, name: "COLOR_THEME_USER_SETTING_UNSPECIFIED", localName: "UNSPECIFIED"}, + {no: 1, name: "COLOR_THEME_USER_SETTING_LIGHT", localName: "LIGHT"}, + {no: 2, name: "COLOR_THEME_USER_SETTING_DARK", localName: "DARK"}, + ], +); + /** * @generated from message slash.store.UserSetting */ @@ -39,6 +52,7 @@ export const UserSetting = proto3.makeMessageType( { no: 2, name: "key", kind: "enum", T: proto3.getEnumType(UserSettingKey) }, { no: 3, name: "access_tokens", kind: "message", T: AccessTokensUserSetting, oneof: "value" }, { no: 4, name: "locale", kind: "enum", T: proto3.getEnumType(LocaleUserSetting), oneof: "value" }, + { no: 5, name: "color_theme", kind: "enum", T: proto3.getEnumType(ColorThemeUserSetting), oneof: "value" }, ], ); diff --git a/proto/api/v2/user_setting_service.proto b/proto/api/v2/user_setting_service.proto index 4acd97d..f041dec 100644 --- a/proto/api/v2/user_setting_service.proto +++ b/proto/api/v2/user_setting_service.proto @@ -34,6 +34,14 @@ message UserSetting { } // locale is the user locale. Locale locale = 2; + + enum ColorTheme { + COLOR_THEME_UNSPECIFIED = 0; + COLOR_THEME_LIGHT = 1; + COLOR_THEME_DARK = 2; + } + // color_theme is the user color theme. + ColorTheme color_theme = 3; } message GetUserSettingRequest { diff --git a/proto/gen/api/v2/README.md b/proto/gen/api/v2/README.md index b609705..57f374c 100644 --- a/proto/gen/api/v2/README.md +++ b/proto/gen/api/v2/README.md @@ -53,6 +53,7 @@ - [UpdateUserSettingResponse](#slash-api-v2-UpdateUserSettingResponse) - [UserSetting](#slash-api-v2-UserSetting) + - [UserSetting.ColorTheme](#slash-api-v2-UserSetting-ColorTheme) - [UserSetting.Locale](#slash-api-v2-UserSetting-Locale) - [UserSettingService](#slash-api-v2-UserSettingService) @@ -680,6 +681,7 @@ | ----- | ---- | ----- | ----------- | | id | [int32](#int32) | | id is the user id. | | locale | [UserSetting.Locale](#slash-api-v2-UserSetting-Locale) | | locale is the user locale. | +| color_theme | [UserSetting.ColorTheme](#slash-api-v2-UserSetting-ColorTheme) | | color_theme is the user color theme. | @@ -688,6 +690,19 @@ + + +### UserSetting.ColorTheme + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| COLOR_THEME_UNSPECIFIED | 0 | | +| COLOR_THEME_LIGHT | 1 | | +| COLOR_THEME_DARK | 2 | | + + + ### UserSetting.Locale diff --git a/proto/gen/api/v2/user_setting_service.pb.go b/proto/gen/api/v2/user_setting_service.pb.go index 77b4323..0b3bf18 100644 --- a/proto/gen/api/v2/user_setting_service.pb.go +++ b/proto/gen/api/v2/user_setting_service.pb.go @@ -70,6 +70,55 @@ func (UserSetting_Locale) EnumDescriptor() ([]byte, []int) { return file_api_v2_user_setting_service_proto_rawDescGZIP(), []int{0, 0} } +type UserSetting_ColorTheme int32 + +const ( + UserSetting_COLOR_THEME_UNSPECIFIED UserSetting_ColorTheme = 0 + UserSetting_COLOR_THEME_LIGHT UserSetting_ColorTheme = 1 + UserSetting_COLOR_THEME_DARK UserSetting_ColorTheme = 2 +) + +// Enum value maps for UserSetting_ColorTheme. +var ( + UserSetting_ColorTheme_name = map[int32]string{ + 0: "COLOR_THEME_UNSPECIFIED", + 1: "COLOR_THEME_LIGHT", + 2: "COLOR_THEME_DARK", + } + UserSetting_ColorTheme_value = map[string]int32{ + "COLOR_THEME_UNSPECIFIED": 0, + "COLOR_THEME_LIGHT": 1, + "COLOR_THEME_DARK": 2, + } +) + +func (x UserSetting_ColorTheme) Enum() *UserSetting_ColorTheme { + p := new(UserSetting_ColorTheme) + *p = x + return p +} + +func (x UserSetting_ColorTheme) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (UserSetting_ColorTheme) Descriptor() protoreflect.EnumDescriptor { + return file_api_v2_user_setting_service_proto_enumTypes[1].Descriptor() +} + +func (UserSetting_ColorTheme) Type() protoreflect.EnumType { + return &file_api_v2_user_setting_service_proto_enumTypes[1] +} + +func (x UserSetting_ColorTheme) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use UserSetting_ColorTheme.Descriptor instead. +func (UserSetting_ColorTheme) EnumDescriptor() ([]byte, []int) { + return file_api_v2_user_setting_service_proto_rawDescGZIP(), []int{0, 1} +} + type UserSetting struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -79,6 +128,8 @@ type UserSetting struct { Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // locale is the user locale. Locale UserSetting_Locale `protobuf:"varint,2,opt,name=locale,proto3,enum=slash.api.v2.UserSetting_Locale" json:"locale,omitempty"` + // color_theme is the user color theme. + ColorTheme UserSetting_ColorTheme `protobuf:"varint,3,opt,name=color_theme,json=colorTheme,proto3,enum=slash.api.v2.UserSetting_ColorTheme" json:"color_theme,omitempty"` } func (x *UserSetting) Reset() { @@ -127,6 +178,13 @@ func (x *UserSetting) GetLocale() UserSetting_Locale { return UserSetting_LOCALE_UNSPECIFIED } +func (x *UserSetting) GetColorTheme() UserSetting_ColorTheme { + if x != nil { + return x.ColorTheme + } + return UserSetting_COLOR_THEME_UNSPECIFIED +} + type GetUserSettingRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -344,70 +402,80 @@ var file_api_v2_user_setting_service_proto_rawDesc = []byte{ 0x32, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6c, 0x69, 0x65, - 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x97, 0x01, 0x0a, 0x0b, 0x55, 0x73, 0x65, + 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb6, 0x02, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, 0x38, 0x0a, 0x06, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x52, 0x06, 0x6c, 0x6f, 0x63, 0x61, - 0x6c, 0x65, 0x22, 0x3e, 0x0a, 0x06, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x12, - 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x45, - 0x4e, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x5a, 0x48, - 0x10, 0x02, 0x22, 0x27, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x56, 0x0a, 0x16, 0x47, - 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, - 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, - 0x69, 0x6e, 0x67, 0x22, 0x89, 0x01, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x3c, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, - 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, - 0x67, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1f, - 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, - 0x59, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x0c, - 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, - 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x75, - 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x32, 0xb0, 0x02, 0x0a, 0x12, 0x55, - 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x12, 0x85, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, - 0x74, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, - 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x73, 0x6c, 0x61, 0x73, - 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x6c, 0x65, 0x12, 0x45, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x74, 0x68, 0x65, 0x6d, + 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, + 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x68, 0x65, 0x6d, 0x65, 0x52, 0x0a, 0x63, + 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x68, 0x65, 0x6d, 0x65, 0x22, 0x3e, 0x0a, 0x06, 0x4c, 0x6f, 0x63, + 0x61, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x55, 0x4e, + 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4c, + 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x45, 0x4e, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x4f, + 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x5a, 0x48, 0x10, 0x02, 0x22, 0x56, 0x0a, 0x0a, 0x43, 0x6f, 0x6c, + 0x6f, 0x72, 0x54, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, 0x4c, 0x4f, 0x52, + 0x5f, 0x54, 0x48, 0x45, 0x4d, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x5f, 0x54, 0x48, + 0x45, 0x4d, 0x45, 0x5f, 0x4c, 0x49, 0x47, 0x48, 0x54, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x43, + 0x4f, 0x4c, 0x4f, 0x52, 0x5f, 0x54, 0x48, 0x45, 0x4d, 0x45, 0x5f, 0x44, 0x41, 0x52, 0x4b, 0x10, + 0x02, 0x22, 0x27, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x56, 0x0a, 0x16, 0x47, 0x65, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, + 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, 0x61, + 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x22, 0x89, 0x01, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x3c, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, + 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, + 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1f, 0x0a, + 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, 0x03, + 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x59, + 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, + 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x75, 0x73, + 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x32, 0xb0, 0x02, 0x0a, 0x12, 0x55, 0x73, + 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x85, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, + 0x69, 0x6e, 0x67, 0x12, 0x23, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, + 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, + 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, + 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x28, + 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x61, 0x70, + 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, + 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x91, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, + 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x26, + 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x28, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, - 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x91, 0x01, 0x0a, 0x11, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, - 0x26, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x2b, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, - 0x22, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, - 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x42, 0xae, 0x01, - 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, - 0x76, 0x32, 0x42, 0x17, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x6f, 0x6f, 0x6a, 0x61, 0x63, - 0x6b, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, - 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, - 0x03, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, - 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, - 0x56, 0x32, 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, - 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, - 0x53, 0x6c, 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2b, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, + 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, + 0x69, 0x64, 0x7d, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x42, 0xae, 0x01, 0x0a, + 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, + 0x32, 0x42, 0x17, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x67, 0x69, + 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x6f, 0x6f, 0x6a, 0x61, 0x63, 0x6b, + 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e, + 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03, + 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e, + 0x56, 0x32, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, + 0x32, 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x53, + 0x6c, 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -422,30 +490,32 @@ func file_api_v2_user_setting_service_proto_rawDescGZIP() []byte { return file_api_v2_user_setting_service_proto_rawDescData } -var file_api_v2_user_setting_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_api_v2_user_setting_service_proto_enumTypes = make([]protoimpl.EnumInfo, 2) var file_api_v2_user_setting_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5) var file_api_v2_user_setting_service_proto_goTypes = []interface{}{ (UserSetting_Locale)(0), // 0: slash.api.v2.UserSetting.Locale - (*UserSetting)(nil), // 1: slash.api.v2.UserSetting - (*GetUserSettingRequest)(nil), // 2: slash.api.v2.GetUserSettingRequest - (*GetUserSettingResponse)(nil), // 3: slash.api.v2.GetUserSettingResponse - (*UpdateUserSettingRequest)(nil), // 4: slash.api.v2.UpdateUserSettingRequest - (*UpdateUserSettingResponse)(nil), // 5: slash.api.v2.UpdateUserSettingResponse + (UserSetting_ColorTheme)(0), // 1: slash.api.v2.UserSetting.ColorTheme + (*UserSetting)(nil), // 2: slash.api.v2.UserSetting + (*GetUserSettingRequest)(nil), // 3: slash.api.v2.GetUserSettingRequest + (*GetUserSettingResponse)(nil), // 4: slash.api.v2.GetUserSettingResponse + (*UpdateUserSettingRequest)(nil), // 5: slash.api.v2.UpdateUserSettingRequest + (*UpdateUserSettingResponse)(nil), // 6: slash.api.v2.UpdateUserSettingResponse } var file_api_v2_user_setting_service_proto_depIdxs = []int32{ 0, // 0: slash.api.v2.UserSetting.locale:type_name -> slash.api.v2.UserSetting.Locale - 1, // 1: slash.api.v2.GetUserSettingResponse.user_setting:type_name -> slash.api.v2.UserSetting - 1, // 2: slash.api.v2.UpdateUserSettingRequest.user_setting:type_name -> slash.api.v2.UserSetting - 1, // 3: slash.api.v2.UpdateUserSettingResponse.user_setting:type_name -> slash.api.v2.UserSetting - 2, // 4: slash.api.v2.UserSettingService.GetUserSetting:input_type -> slash.api.v2.GetUserSettingRequest - 4, // 5: slash.api.v2.UserSettingService.UpdateUserSetting:input_type -> slash.api.v2.UpdateUserSettingRequest - 3, // 6: slash.api.v2.UserSettingService.GetUserSetting:output_type -> slash.api.v2.GetUserSettingResponse - 5, // 7: slash.api.v2.UserSettingService.UpdateUserSetting:output_type -> slash.api.v2.UpdateUserSettingResponse - 6, // [6:8] is the sub-list for method output_type - 4, // [4:6] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 1, // 1: slash.api.v2.UserSetting.color_theme:type_name -> slash.api.v2.UserSetting.ColorTheme + 2, // 2: slash.api.v2.GetUserSettingResponse.user_setting:type_name -> slash.api.v2.UserSetting + 2, // 3: slash.api.v2.UpdateUserSettingRequest.user_setting:type_name -> slash.api.v2.UserSetting + 2, // 4: slash.api.v2.UpdateUserSettingResponse.user_setting:type_name -> slash.api.v2.UserSetting + 3, // 5: slash.api.v2.UserSettingService.GetUserSetting:input_type -> slash.api.v2.GetUserSettingRequest + 5, // 6: slash.api.v2.UserSettingService.UpdateUserSetting:input_type -> slash.api.v2.UpdateUserSettingRequest + 4, // 7: slash.api.v2.UserSettingService.GetUserSetting:output_type -> slash.api.v2.GetUserSettingResponse + 6, // 8: slash.api.v2.UserSettingService.UpdateUserSetting:output_type -> slash.api.v2.UpdateUserSettingResponse + 7, // [7:9] is the sub-list for method output_type + 5, // [5:7] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_api_v2_user_setting_service_proto_init() } @@ -520,7 +590,7 @@ func file_api_v2_user_setting_service_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_api_v2_user_setting_service_proto_rawDesc, - NumEnums: 1, + NumEnums: 2, NumMessages: 5, NumExtensions: 0, NumServices: 1, diff --git a/proto/gen/store/README.md b/proto/gen/store/README.md index b796d1c..1670b1d 100644 --- a/proto/gen/store/README.md +++ b/proto/gen/store/README.md @@ -20,6 +20,7 @@ - [AccessTokensUserSetting.AccessToken](#slash-store-AccessTokensUserSetting-AccessToken) - [UserSetting](#slash-store-UserSetting) + - [ColorThemeUserSetting](#slash-store-ColorThemeUserSetting) - [LocaleUserSetting](#slash-store-LocaleUserSetting) - [UserSettingKey](#slash-store-UserSettingKey) @@ -216,6 +217,7 @@ | key | [UserSettingKey](#slash-store-UserSettingKey) | | | | access_tokens | [AccessTokensUserSetting](#slash-store-AccessTokensUserSetting) | | | | locale | [LocaleUserSetting](#slash-store-LocaleUserSetting) | | | +| color_theme | [ColorThemeUserSetting](#slash-store-ColorThemeUserSetting) | | | @@ -224,6 +226,19 @@ + + +### ColorThemeUserSetting + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| COLOR_THEME_USER_SETTING_UNSPECIFIED | 0 | | +| COLOR_THEME_USER_SETTING_LIGHT | 1 | | +| COLOR_THEME_USER_SETTING_DARK | 2 | | + + + ### LocaleUserSetting @@ -247,6 +262,7 @@ | USER_SETTING_KEY_UNSPECIFIED | 0 | | | USER_SETTING_ACCESS_TOKENS | 1 | Access tokens for the user. | | USER_SETTING_LOCALE | 2 | Locale for the user. | +| USER_SETTING_COLOR_THEME | 3 | Color theme for the user. | diff --git a/proto/gen/store/user_setting.pb.go b/proto/gen/store/user_setting.pb.go index 6655258..7429844 100644 --- a/proto/gen/store/user_setting.pb.go +++ b/proto/gen/store/user_setting.pb.go @@ -28,6 +28,8 @@ const ( UserSettingKey_USER_SETTING_ACCESS_TOKENS UserSettingKey = 1 // Locale for the user. UserSettingKey_USER_SETTING_LOCALE UserSettingKey = 2 + // Color theme for the user. + UserSettingKey_USER_SETTING_COLOR_THEME UserSettingKey = 3 ) // Enum value maps for UserSettingKey. @@ -36,11 +38,13 @@ var ( 0: "USER_SETTING_KEY_UNSPECIFIED", 1: "USER_SETTING_ACCESS_TOKENS", 2: "USER_SETTING_LOCALE", + 3: "USER_SETTING_COLOR_THEME", } UserSettingKey_value = map[string]int32{ "USER_SETTING_KEY_UNSPECIFIED": 0, "USER_SETTING_ACCESS_TOKENS": 1, "USER_SETTING_LOCALE": 2, + "USER_SETTING_COLOR_THEME": 3, } ) @@ -120,6 +124,55 @@ func (LocaleUserSetting) EnumDescriptor() ([]byte, []int) { return file_store_user_setting_proto_rawDescGZIP(), []int{1} } +type ColorThemeUserSetting int32 + +const ( + ColorThemeUserSetting_COLOR_THEME_USER_SETTING_UNSPECIFIED ColorThemeUserSetting = 0 + ColorThemeUserSetting_COLOR_THEME_USER_SETTING_LIGHT ColorThemeUserSetting = 1 + ColorThemeUserSetting_COLOR_THEME_USER_SETTING_DARK ColorThemeUserSetting = 2 +) + +// Enum value maps for ColorThemeUserSetting. +var ( + ColorThemeUserSetting_name = map[int32]string{ + 0: "COLOR_THEME_USER_SETTING_UNSPECIFIED", + 1: "COLOR_THEME_USER_SETTING_LIGHT", + 2: "COLOR_THEME_USER_SETTING_DARK", + } + ColorThemeUserSetting_value = map[string]int32{ + "COLOR_THEME_USER_SETTING_UNSPECIFIED": 0, + "COLOR_THEME_USER_SETTING_LIGHT": 1, + "COLOR_THEME_USER_SETTING_DARK": 2, + } +) + +func (x ColorThemeUserSetting) Enum() *ColorThemeUserSetting { + p := new(ColorThemeUserSetting) + *p = x + return p +} + +func (x ColorThemeUserSetting) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ColorThemeUserSetting) Descriptor() protoreflect.EnumDescriptor { + return file_store_user_setting_proto_enumTypes[2].Descriptor() +} + +func (ColorThemeUserSetting) Type() protoreflect.EnumType { + return &file_store_user_setting_proto_enumTypes[2] +} + +func (x ColorThemeUserSetting) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use ColorThemeUserSetting.Descriptor instead. +func (ColorThemeUserSetting) EnumDescriptor() ([]byte, []int) { + return file_store_user_setting_proto_rawDescGZIP(), []int{2} +} + type UserSetting struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -131,6 +184,7 @@ type UserSetting struct { // // *UserSetting_AccessTokens // *UserSetting_Locale + // *UserSetting_ColorTheme Value isUserSetting_Value `protobuf_oneof:"value"` } @@ -201,6 +255,13 @@ func (x *UserSetting) GetLocale() LocaleUserSetting { return LocaleUserSetting_LOCALE_USER_SETTING_UNSPECIFIED } +func (x *UserSetting) GetColorTheme() ColorThemeUserSetting { + if x, ok := x.GetValue().(*UserSetting_ColorTheme); ok { + return x.ColorTheme + } + return ColorThemeUserSetting_COLOR_THEME_USER_SETTING_UNSPECIFIED +} + type isUserSetting_Value interface { isUserSetting_Value() } @@ -213,10 +274,16 @@ type UserSetting_Locale struct { Locale LocaleUserSetting `protobuf:"varint,4,opt,name=locale,proto3,enum=slash.store.LocaleUserSetting,oneof"` } +type UserSetting_ColorTheme struct { + ColorTheme ColorThemeUserSetting `protobuf:"varint,5,opt,name=color_theme,json=colorTheme,proto3,enum=slash.store.ColorThemeUserSetting,oneof"` +} + func (*UserSetting_AccessTokens) isUserSetting_Value() {} func (*UserSetting_Locale) isUserSetting_Value() {} +func (*UserSetting_ColorTheme) isUserSetting_Value() {} + type AccessTokensUserSetting struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -327,7 +394,7 @@ var File_store_user_setting_proto protoreflect.FileDescriptor var file_store_user_setting_proto_rawDesc = []byte{ 0x0a, 0x18, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0b, 0x73, 0x6c, 0x61, 0x73, - 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0xe5, 0x01, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, + 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0xac, 0x02, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, @@ -341,44 +408,59 @@ var file_store_user_setting_proto_rawDesc = []byte{ 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x48, 0x00, 0x52, 0x06, - 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, - 0xc4, 0x01, 0x0a, 0x17, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, - 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x55, 0x0a, 0x0d, 0x61, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, - 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x55, 0x73, 0x65, - 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x73, 0x1a, 0x52, 0x0a, 0x0b, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x6b, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, - 0x74, 0x74, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x20, 0x0a, 0x1c, 0x55, 0x53, 0x45, 0x52, - 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x55, 0x4e, 0x53, - 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x55, 0x53, - 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, - 0x53, 0x5f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x53, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x55, 0x53, - 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x4c, - 0x45, 0x10, 0x02, 0x2a, 0x70, 0x0a, 0x11, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x0a, 0x1f, 0x4c, 0x4f, 0x43, 0x41, - 0x4c, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, - 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, - 0x16, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, - 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x4e, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x4c, 0x4f, 0x43, - 0x41, 0x4c, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, - 0x5f, 0x5a, 0x48, 0x10, 0x02, 0x42, 0x9a, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, - 0x61, 0x73, 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x10, 0x55, 0x73, 0x65, 0x72, 0x53, - 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x6f, 0x6f, 0x6a, 0x61, 0x63, - 0x6b, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, - 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0xa2, 0x02, 0x03, 0x53, 0x53, 0x58, 0xaa, 0x02, 0x0b, - 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xca, 0x02, 0x0b, 0x53, 0x6c, - 0x61, 0x73, 0x68, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xe2, 0x02, 0x17, 0x53, 0x6c, 0x61, 0x73, - 0x68, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x53, 0x74, 0x6f, - 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x45, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, + 0x74, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x73, 0x6c, + 0x61, 0x73, 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, + 0x68, 0x65, 0x6d, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x48, + 0x00, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x68, 0x65, 0x6d, 0x65, 0x42, 0x07, 0x0a, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xc4, 0x01, 0x0a, 0x17, 0x41, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, + 0x6e, 0x67, 0x12, 0x55, 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x73, 0x6c, 0x61, 0x73, + 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x73, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e, + 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0c, 0x61, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x1a, 0x52, 0x0a, 0x0b, 0x41, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, + 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x89, 0x01, + 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, + 0x12, 0x20, 0x0a, 0x1c, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, + 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, + 0x4e, 0x47, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x53, + 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, + 0x4e, 0x47, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x55, + 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x43, 0x4f, 0x4c, 0x4f, + 0x52, 0x5f, 0x54, 0x48, 0x45, 0x4d, 0x45, 0x10, 0x03, 0x2a, 0x70, 0x0a, 0x11, 0x4c, 0x6f, 0x63, + 0x61, 0x6c, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x23, + 0x0a, 0x1f, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45, + 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x55, 0x53, + 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x4e, 0x10, 0x01, 0x12, + 0x1a, 0x0a, 0x16, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, + 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x5a, 0x48, 0x10, 0x02, 0x2a, 0x88, 0x01, 0x0a, 0x15, + 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x68, 0x65, 0x6d, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, + 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x28, 0x0a, 0x24, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x5f, 0x54, + 0x48, 0x45, 0x4d, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, + 0x47, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x22, 0x0a, 0x1e, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x5f, 0x54, 0x48, 0x45, 0x4d, 0x45, 0x5f, 0x55, + 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x4c, 0x49, 0x47, 0x48, + 0x54, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x5f, 0x54, 0x48, 0x45, + 0x4d, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, + 0x44, 0x41, 0x52, 0x4b, 0x10, 0x02, 0x42, 0x9a, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x73, + 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x10, 0x55, 0x73, 0x65, 0x72, + 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x6f, 0x6f, 0x6a, 0x61, + 0x63, 0x6b, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, + 0x65, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0xa2, 0x02, 0x03, 0x53, 0x53, 0x58, 0xaa, 0x02, + 0x0b, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xca, 0x02, 0x0b, 0x53, + 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xe2, 0x02, 0x17, 0x53, 0x6c, 0x61, + 0x73, 0x68, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x53, 0x74, + 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -393,25 +475,27 @@ func file_store_user_setting_proto_rawDescGZIP() []byte { return file_store_user_setting_proto_rawDescData } -var file_store_user_setting_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_store_user_setting_proto_enumTypes = make([]protoimpl.EnumInfo, 3) var file_store_user_setting_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_store_user_setting_proto_goTypes = []interface{}{ (UserSettingKey)(0), // 0: slash.store.UserSettingKey (LocaleUserSetting)(0), // 1: slash.store.LocaleUserSetting - (*UserSetting)(nil), // 2: slash.store.UserSetting - (*AccessTokensUserSetting)(nil), // 3: slash.store.AccessTokensUserSetting - (*AccessTokensUserSetting_AccessToken)(nil), // 4: slash.store.AccessTokensUserSetting.AccessToken + (ColorThemeUserSetting)(0), // 2: slash.store.ColorThemeUserSetting + (*UserSetting)(nil), // 3: slash.store.UserSetting + (*AccessTokensUserSetting)(nil), // 4: slash.store.AccessTokensUserSetting + (*AccessTokensUserSetting_AccessToken)(nil), // 5: slash.store.AccessTokensUserSetting.AccessToken } var file_store_user_setting_proto_depIdxs = []int32{ 0, // 0: slash.store.UserSetting.key:type_name -> slash.store.UserSettingKey - 3, // 1: slash.store.UserSetting.access_tokens:type_name -> slash.store.AccessTokensUserSetting + 4, // 1: slash.store.UserSetting.access_tokens:type_name -> slash.store.AccessTokensUserSetting 1, // 2: slash.store.UserSetting.locale:type_name -> slash.store.LocaleUserSetting - 4, // 3: slash.store.AccessTokensUserSetting.access_tokens:type_name -> slash.store.AccessTokensUserSetting.AccessToken - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 2, // 3: slash.store.UserSetting.color_theme:type_name -> slash.store.ColorThemeUserSetting + 5, // 4: slash.store.AccessTokensUserSetting.access_tokens:type_name -> slash.store.AccessTokensUserSetting.AccessToken + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_store_user_setting_proto_init() } @@ -460,13 +544,14 @@ func file_store_user_setting_proto_init() { file_store_user_setting_proto_msgTypes[0].OneofWrappers = []interface{}{ (*UserSetting_AccessTokens)(nil), (*UserSetting_Locale)(nil), + (*UserSetting_ColorTheme)(nil), } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_store_user_setting_proto_rawDesc, - NumEnums: 2, + NumEnums: 3, NumMessages: 3, NumExtensions: 0, NumServices: 0, diff --git a/proto/store/user_setting.proto b/proto/store/user_setting.proto index 7a0c836..3feb8ea 100644 --- a/proto/store/user_setting.proto +++ b/proto/store/user_setting.proto @@ -13,6 +13,8 @@ message UserSetting { AccessTokensUserSetting access_tokens = 3; LocaleUserSetting locale = 4; + + ColorThemeUserSetting color_theme = 5; } } @@ -22,6 +24,8 @@ enum UserSettingKey { USER_SETTING_ACCESS_TOKENS = 1; // Locale for the user. USER_SETTING_LOCALE = 2; + // Color theme for the user. + USER_SETTING_COLOR_THEME = 3; } message AccessTokensUserSetting { @@ -40,3 +44,9 @@ enum LocaleUserSetting { LOCALE_USER_SETTING_EN = 1; LOCALE_USER_SETTING_ZH = 2; } + +enum ColorThemeUserSetting { + COLOR_THEME_USER_SETTING_UNSPECIFIED = 0; + COLOR_THEME_USER_SETTING_LIGHT = 1; + COLOR_THEME_USER_SETTING_DARK = 2; +} diff --git a/store/user_setting.go b/store/user_setting.go index aa85c4a..ef7cda1 100644 --- a/store/user_setting.go +++ b/store/user_setting.go @@ -33,6 +33,8 @@ func (s *Store) UpsertUserSetting(ctx context.Context, upsert *storepb.UserSetti valueString = string(valueBytes) } else if upsert.Key == storepb.UserSettingKey_USER_SETTING_LOCALE { valueString = upsert.GetLocale().String() + } else if upsert.Key == storepb.UserSettingKey_USER_SETTING_COLOR_THEME { + valueString = upsert.GetColorTheme().String() } else { return nil, errors.New("invalid user setting key") } @@ -93,6 +95,10 @@ func (s *Store) ListUserSettings(ctx context.Context, find *FindUserSetting) ([] userSetting.Value = &storepb.UserSetting_Locale{ Locale: convertUserSettingLocaleFromString(valueString), } + } else if userSetting.Key == storepb.UserSettingKey_USER_SETTING_COLOR_THEME { + userSetting.Value = &storepb.UserSetting_ColorTheme{ + ColorTheme: convertUserSettingColorThemeFromString(valueString), + } } else { return nil, errors.New("invalid user setting key") } @@ -176,3 +182,14 @@ func convertUserSettingLocaleFromString(s string) storepb.LocaleUserSetting { return storepb.LocaleUserSetting_LOCALE_USER_SETTING_UNSPECIFIED } } + +func convertUserSettingColorThemeFromString(s string) storepb.ColorThemeUserSetting { + switch s { + case "COLOR_THEME_USER_SETTING_LIGHT": + return storepb.ColorThemeUserSetting_COLOR_THEME_USER_SETTING_LIGHT + case "COLOR_THEME_USER_SETTING_DARK": + return storepb.ColorThemeUserSetting_COLOR_THEME_USER_SETTING_DARK + default: + return storepb.ColorThemeUserSetting_COLOR_THEME_USER_SETTING_UNSPECIFIED + } +} diff --git a/test/store/user_setting_test.go b/test/store/user_setting_test.go index 528de9b..570fe79 100644 --- a/test/store/user_setting_test.go +++ b/test/store/user_setting_test.go @@ -94,4 +94,26 @@ func TestUserSettingStore(t *testing.T) { }) require.NoError(t, err) require.Equal(t, storepb.LocaleUserSetting_LOCALE_USER_SETTING_EN, localeUserSetting.GetLocale()) + + // Test for color theme user setting. + colorThemeUserSetting, err := ts.UpsertUserSetting(ctx, &storepb.UserSetting{ + UserId: user.ID, + Key: storepb.UserSettingKey_USER_SETTING_COLOR_THEME, + Value: &storepb.UserSetting_ColorTheme{ + ColorTheme: storepb.ColorThemeUserSetting_COLOR_THEME_USER_SETTING_LIGHT, + }, + }) + require.NoError(t, err) + require.NotNil(t, colorThemeUserSetting) + require.Equal(t, storepb.UserSettingKey_USER_SETTING_COLOR_THEME, colorThemeUserSetting.Key) + require.Equal(t, storepb.ColorThemeUserSetting_COLOR_THEME_USER_SETTING_LIGHT, colorThemeUserSetting.GetColorTheme()) + colorThemeUserSetting, err = ts.UpsertUserSetting(ctx, &storepb.UserSetting{ + UserId: user.ID, + Key: storepb.UserSettingKey_USER_SETTING_COLOR_THEME, + Value: &storepb.UserSetting_ColorTheme{ + ColorTheme: storepb.ColorThemeUserSetting_COLOR_THEME_USER_SETTING_DARK, + }, + }) + require.NoError(t, err) + require.Equal(t, storepb.ColorThemeUserSetting_COLOR_THEME_USER_SETTING_DARK, colorThemeUserSetting.GetColorTheme()) }