feat: add color theme user setting definition

This commit is contained in:
steven 2023-09-05 23:48:32 +08:00
parent 7348f47ef8
commit b50e809125
16 changed files with 545 additions and 128 deletions

View File

@ -24,6 +24,13 @@ export declare class UserSetting extends Message<UserSetting> {
*/ */
locale: UserSetting_Locale; 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<UserSetting>); constructor(data?: PartialMessage<UserSetting>);
static readonly runtime: typeof proto3; static readonly runtime: typeof proto3;
@ -59,6 +66,26 @@ export declare enum UserSetting_Locale {
ZH = 2, 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 * @generated from message slash.api.v2.GetUserSettingRequest
*/ */

View File

@ -13,6 +13,7 @@ export const UserSetting = proto3.makeMessageType(
() => [ () => [
{ no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
{ no: 2, name: "locale", kind: "enum", T: proto3.getEnumType(UserSetting_Locale) }, { 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 * @generated from message slash.api.v2.GetUserSettingRequest
*/ */

View File

@ -28,6 +28,13 @@ export declare enum UserSettingKey {
* @generated from enum value: USER_SETTING_LOCALE = 2; * @generated from enum value: USER_SETTING_LOCALE = 2;
*/ */
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, 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 * @generated from message slash.store.UserSetting
*/ */
@ -79,6 +106,12 @@ export declare class UserSetting extends Message<UserSetting> {
*/ */
value: LocaleUserSetting; value: LocaleUserSetting;
case: "locale"; case: "locale";
} | {
/**
* @generated from field: slash.store.ColorThemeUserSetting color_theme = 5;
*/
value: ColorThemeUserSetting;
case: "colorTheme";
} | { case: undefined; value?: undefined }; } | { case: undefined; value?: undefined };
constructor(data?: PartialMessage<UserSetting>); constructor(data?: PartialMessage<UserSetting>);

View File

@ -14,6 +14,7 @@ export const UserSettingKey = proto3.makeEnum(
{no: 0, name: "USER_SETTING_KEY_UNSPECIFIED"}, {no: 0, name: "USER_SETTING_KEY_UNSPECIFIED"},
{no: 1, name: "USER_SETTING_ACCESS_TOKENS"}, {no: 1, name: "USER_SETTING_ACCESS_TOKENS"},
{no: 2, name: "USER_SETTING_LOCALE"}, {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 * @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: 2, name: "key", kind: "enum", T: proto3.getEnumType(UserSettingKey) },
{ no: 3, name: "access_tokens", kind: "message", T: AccessTokensUserSetting, oneof: "value" }, { no: 3, name: "access_tokens", kind: "message", T: AccessTokensUserSetting, oneof: "value" },
{ no: 4, name: "locale", kind: "enum", T: proto3.getEnumType(LocaleUserSetting), 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" },
], ],
); );

View File

@ -24,6 +24,13 @@ export declare class UserSetting extends Message<UserSetting> {
*/ */
locale: UserSetting_Locale; 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<UserSetting>); constructor(data?: PartialMessage<UserSetting>);
static readonly runtime: typeof proto3; static readonly runtime: typeof proto3;
@ -59,6 +66,26 @@ export declare enum UserSetting_Locale {
ZH = 2, 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 * @generated from message slash.api.v2.GetUserSettingRequest
*/ */

View File

@ -13,6 +13,7 @@ export const UserSetting = proto3.makeMessageType(
() => [ () => [
{ no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ }, { no: 1, name: "id", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
{ no: 2, name: "locale", kind: "enum", T: proto3.getEnumType(UserSetting_Locale) }, { 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 * @generated from message slash.api.v2.GetUserSettingRequest
*/ */

View File

@ -28,6 +28,13 @@ export declare enum UserSettingKey {
* @generated from enum value: USER_SETTING_LOCALE = 2; * @generated from enum value: USER_SETTING_LOCALE = 2;
*/ */
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, 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 * @generated from message slash.store.UserSetting
*/ */
@ -79,6 +106,12 @@ export declare class UserSetting extends Message<UserSetting> {
*/ */
value: LocaleUserSetting; value: LocaleUserSetting;
case: "locale"; case: "locale";
} | {
/**
* @generated from field: slash.store.ColorThemeUserSetting color_theme = 5;
*/
value: ColorThemeUserSetting;
case: "colorTheme";
} | { case: undefined; value?: undefined }; } | { case: undefined; value?: undefined };
constructor(data?: PartialMessage<UserSetting>); constructor(data?: PartialMessage<UserSetting>);

View File

@ -14,6 +14,7 @@ export const UserSettingKey = proto3.makeEnum(
{no: 0, name: "USER_SETTING_KEY_UNSPECIFIED"}, {no: 0, name: "USER_SETTING_KEY_UNSPECIFIED"},
{no: 1, name: "USER_SETTING_ACCESS_TOKENS"}, {no: 1, name: "USER_SETTING_ACCESS_TOKENS"},
{no: 2, name: "USER_SETTING_LOCALE"}, {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 * @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: 2, name: "key", kind: "enum", T: proto3.getEnumType(UserSettingKey) },
{ no: 3, name: "access_tokens", kind: "message", T: AccessTokensUserSetting, oneof: "value" }, { no: 3, name: "access_tokens", kind: "message", T: AccessTokensUserSetting, oneof: "value" },
{ no: 4, name: "locale", kind: "enum", T: proto3.getEnumType(LocaleUserSetting), 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" },
], ],
); );

View File

@ -34,6 +34,14 @@ message UserSetting {
} }
// locale is the user locale. // locale is the user locale.
Locale locale = 2; 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 { message GetUserSettingRequest {

View File

@ -53,6 +53,7 @@
- [UpdateUserSettingResponse](#slash-api-v2-UpdateUserSettingResponse) - [UpdateUserSettingResponse](#slash-api-v2-UpdateUserSettingResponse)
- [UserSetting](#slash-api-v2-UserSetting) - [UserSetting](#slash-api-v2-UserSetting)
- [UserSetting.ColorTheme](#slash-api-v2-UserSetting-ColorTheme)
- [UserSetting.Locale](#slash-api-v2-UserSetting-Locale) - [UserSetting.Locale](#slash-api-v2-UserSetting-Locale)
- [UserSettingService](#slash-api-v2-UserSettingService) - [UserSettingService](#slash-api-v2-UserSettingService)
@ -680,6 +681,7 @@
| ----- | ---- | ----- | ----------- | | ----- | ---- | ----- | ----------- |
| id | [int32](#int32) | | id is the user id. | | id | [int32](#int32) | | id is the user id. |
| locale | [UserSetting.Locale](#slash-api-v2-UserSetting-Locale) | | locale is the user locale. | | 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 @@
<a name="slash-api-v2-UserSetting-ColorTheme"></a>
### UserSetting.ColorTheme
| Name | Number | Description |
| ---- | ------ | ----------- |
| COLOR_THEME_UNSPECIFIED | 0 | |
| COLOR_THEME_LIGHT | 1 | |
| COLOR_THEME_DARK | 2 | |
<a name="slash-api-v2-UserSetting-Locale"></a> <a name="slash-api-v2-UserSetting-Locale"></a>
### UserSetting.Locale ### UserSetting.Locale

View File

@ -70,6 +70,55 @@ func (UserSetting_Locale) EnumDescriptor() ([]byte, []int) {
return file_api_v2_user_setting_service_proto_rawDescGZIP(), []int{0, 0} 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 { type UserSetting struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -79,6 +128,8 @@ type UserSetting struct {
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
// locale is the user locale. // locale is the user locale.
Locale UserSetting_Locale `protobuf:"varint,2,opt,name=locale,proto3,enum=slash.api.v2.UserSetting_Locale" json:"locale,omitempty"` 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() { func (x *UserSetting) Reset() {
@ -127,6 +178,13 @@ func (x *UserSetting) GetLocale() UserSetting_Locale {
return UserSetting_LOCALE_UNSPECIFIED return UserSetting_LOCALE_UNSPECIFIED
} }
func (x *UserSetting) GetColorTheme() UserSetting_ColorTheme {
if x != nil {
return x.ColorTheme
}
return UserSetting_COLOR_THEME_UNSPECIFIED
}
type GetUserSettingRequest struct { type GetUserSettingRequest struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache 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, 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, 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, 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, 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, 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, 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, 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, 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, 0x6c, 0x65, 0x12, 0x45, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x74, 0x68, 0x65, 0x6d,
0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e,
0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x45, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69,
0x4e, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x5a, 0x48, 0x6e, 0x67, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x68, 0x65, 0x6d, 0x65, 0x52, 0x0a, 0x63,
0x10, 0x02, 0x22, 0x27, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x68, 0x65, 0x6d, 0x65, 0x22, 0x3e, 0x0a, 0x06, 0x4c, 0x6f, 0x63,
0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x61, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x55, 0x4e,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x56, 0x0a, 0x16, 0x47, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4c,
0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x45, 0x4e, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4c, 0x4f,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x5a, 0x48, 0x10, 0x02, 0x22, 0x56, 0x0a, 0x0a, 0x43, 0x6f, 0x6c,
0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, 0x6f, 0x72, 0x54, 0x68, 0x65, 0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x43, 0x4f, 0x4c, 0x4f, 0x52,
0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x5f, 0x54, 0x48, 0x45, 0x4d, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49,
0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x5f, 0x54, 0x48,
0x69, 0x6e, 0x67, 0x22, 0x89, 0x01, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x45, 0x4d, 0x45, 0x5f, 0x4c, 0x49, 0x47, 0x48, 0x54, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x43,
0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x4f, 0x4c, 0x4f, 0x52, 0x5f, 0x54, 0x48, 0x45, 0x4d, 0x45, 0x5f, 0x44, 0x41, 0x52, 0x4b, 0x10,
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x02, 0x22, 0x27, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74,
0x12, 0x3c, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22, 0x56, 0x0a, 0x16, 0x47, 0x65,
0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70,
0x67, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1f, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74,
0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, 0x61,
0x03, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65,
0x59, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69,
0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3c, 0x0a, 0x0c, 0x6e, 0x67, 0x22, 0x89, 0x01, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65,
0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x12,
0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x0b, 0x75, 0x3c, 0x0a, 0x0c, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x18,
0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x32, 0xb0, 0x02, 0x0a, 0x12, 0x55, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70,
0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67,
0x65, 0x12, 0x85, 0x01, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x52, 0x0b, 0x75, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x1f, 0x0a,
0x74, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x03, 0x20, 0x03,
0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x28, 0x09, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x22, 0x59,
0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x0a, 0x19, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74,
0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 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, 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, 0x2b, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22,
0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b,
0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x12, 0x91, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x69, 0x64, 0x7d, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x42, 0xae, 0x01, 0x0a,
0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76,
0x26, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x32, 0x42, 0x17, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x65,
0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x67, 0x69,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x6f, 0x6f, 0x6a, 0x61, 0x63, 0x6b,
0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x6e,
0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x3b, 0x61, 0x70, 0x69, 0x76, 0x32, 0xa2, 0x02, 0x03,
0x22, 0x2b, 0xda, 0x41, 0x02, 0x69, 0x64, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x53, 0x41, 0x58, 0xaa, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x41, 0x70, 0x69, 0x2e,
0x22, 0x1b, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x32, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x56, 0x32, 0xca, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56,
0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x73, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x73, 0x42, 0xae, 0x01, 0x32, 0xe2, 0x02, 0x18, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x5c, 0x41, 0x70, 0x69, 0x5c, 0x56, 0x32,
0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x53,
0x76, 0x32, 0x42, 0x17, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x41, 0x70, 0x69, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x67, 0x72, 0x6f, 0x74, 0x6f, 0x33,
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 ( var (
@ -422,30 +490,32 @@ func file_api_v2_user_setting_service_proto_rawDescGZIP() []byte {
return file_api_v2_user_setting_service_proto_rawDescData 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_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_api_v2_user_setting_service_proto_goTypes = []interface{}{ var file_api_v2_user_setting_service_proto_goTypes = []interface{}{
(UserSetting_Locale)(0), // 0: slash.api.v2.UserSetting.Locale (UserSetting_Locale)(0), // 0: slash.api.v2.UserSetting.Locale
(*UserSetting)(nil), // 1: slash.api.v2.UserSetting (UserSetting_ColorTheme)(0), // 1: slash.api.v2.UserSetting.ColorTheme
(*GetUserSettingRequest)(nil), // 2: slash.api.v2.GetUserSettingRequest (*UserSetting)(nil), // 2: slash.api.v2.UserSetting
(*GetUserSettingResponse)(nil), // 3: slash.api.v2.GetUserSettingResponse (*GetUserSettingRequest)(nil), // 3: slash.api.v2.GetUserSettingRequest
(*UpdateUserSettingRequest)(nil), // 4: slash.api.v2.UpdateUserSettingRequest (*GetUserSettingResponse)(nil), // 4: slash.api.v2.GetUserSettingResponse
(*UpdateUserSettingResponse)(nil), // 5: slash.api.v2.UpdateUserSettingResponse (*UpdateUserSettingRequest)(nil), // 5: slash.api.v2.UpdateUserSettingRequest
(*UpdateUserSettingResponse)(nil), // 6: slash.api.v2.UpdateUserSettingResponse
} }
var file_api_v2_user_setting_service_proto_depIdxs = []int32{ var file_api_v2_user_setting_service_proto_depIdxs = []int32{
0, // 0: slash.api.v2.UserSetting.locale:type_name -> slash.api.v2.UserSetting.Locale 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, // 1: slash.api.v2.UserSetting.color_theme:type_name -> slash.api.v2.UserSetting.ColorTheme
1, // 2: slash.api.v2.UpdateUserSettingRequest.user_setting:type_name -> slash.api.v2.UserSetting 2, // 2: slash.api.v2.GetUserSettingResponse.user_setting:type_name -> slash.api.v2.UserSetting
1, // 3: slash.api.v2.UpdateUserSettingResponse.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.UserSettingService.GetUserSetting:input_type -> slash.api.v2.GetUserSettingRequest 2, // 4: slash.api.v2.UpdateUserSettingResponse.user_setting:type_name -> slash.api.v2.UserSetting
4, // 5: slash.api.v2.UserSettingService.UpdateUserSetting:input_type -> slash.api.v2.UpdateUserSettingRequest 3, // 5: slash.api.v2.UserSettingService.GetUserSetting:input_type -> slash.api.v2.GetUserSettingRequest
3, // 6: slash.api.v2.UserSettingService.GetUserSetting:output_type -> slash.api.v2.GetUserSettingResponse 5, // 6: slash.api.v2.UserSettingService.UpdateUserSetting:input_type -> slash.api.v2.UpdateUserSettingRequest
5, // 7: slash.api.v2.UserSettingService.UpdateUserSetting:output_type -> slash.api.v2.UpdateUserSettingResponse 4, // 7: slash.api.v2.UserSettingService.GetUserSetting:output_type -> slash.api.v2.GetUserSettingResponse
6, // [6:8] is the sub-list for method output_type 6, // 8: slash.api.v2.UserSettingService.UpdateUserSetting:output_type -> slash.api.v2.UpdateUserSettingResponse
4, // [4:6] is the sub-list for method input_type 7, // [7:9] is the sub-list for method output_type
4, // [4:4] is the sub-list for extension type_name 5, // [5:7] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension extendee 5, // [5:5] is the sub-list for extension type_name
0, // [0:4] is the sub-list for field 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() } 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{ File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_api_v2_user_setting_service_proto_rawDesc, RawDescriptor: file_api_v2_user_setting_service_proto_rawDesc,
NumEnums: 1, NumEnums: 2,
NumMessages: 5, NumMessages: 5,
NumExtensions: 0, NumExtensions: 0,
NumServices: 1, NumServices: 1,

View File

@ -20,6 +20,7 @@
- [AccessTokensUserSetting.AccessToken](#slash-store-AccessTokensUserSetting-AccessToken) - [AccessTokensUserSetting.AccessToken](#slash-store-AccessTokensUserSetting-AccessToken)
- [UserSetting](#slash-store-UserSetting) - [UserSetting](#slash-store-UserSetting)
- [ColorThemeUserSetting](#slash-store-ColorThemeUserSetting)
- [LocaleUserSetting](#slash-store-LocaleUserSetting) - [LocaleUserSetting](#slash-store-LocaleUserSetting)
- [UserSettingKey](#slash-store-UserSettingKey) - [UserSettingKey](#slash-store-UserSettingKey)
@ -216,6 +217,7 @@
| key | [UserSettingKey](#slash-store-UserSettingKey) | | | | key | [UserSettingKey](#slash-store-UserSettingKey) | | |
| access_tokens | [AccessTokensUserSetting](#slash-store-AccessTokensUserSetting) | | | | access_tokens | [AccessTokensUserSetting](#slash-store-AccessTokensUserSetting) | | |
| locale | [LocaleUserSetting](#slash-store-LocaleUserSetting) | | | | locale | [LocaleUserSetting](#slash-store-LocaleUserSetting) | | |
| color_theme | [ColorThemeUserSetting](#slash-store-ColorThemeUserSetting) | | |
@ -224,6 +226,19 @@
<a name="slash-store-ColorThemeUserSetting"></a>
### ColorThemeUserSetting
| Name | Number | Description |
| ---- | ------ | ----------- |
| COLOR_THEME_USER_SETTING_UNSPECIFIED | 0 | |
| COLOR_THEME_USER_SETTING_LIGHT | 1 | |
| COLOR_THEME_USER_SETTING_DARK | 2 | |
<a name="slash-store-LocaleUserSetting"></a> <a name="slash-store-LocaleUserSetting"></a>
### LocaleUserSetting ### LocaleUserSetting
@ -247,6 +262,7 @@
| USER_SETTING_KEY_UNSPECIFIED | 0 | | | USER_SETTING_KEY_UNSPECIFIED | 0 | |
| USER_SETTING_ACCESS_TOKENS | 1 | Access tokens for the user. | | USER_SETTING_ACCESS_TOKENS | 1 | Access tokens for the user. |
| USER_SETTING_LOCALE | 2 | Locale for the user. | | USER_SETTING_LOCALE | 2 | Locale for the user. |
| USER_SETTING_COLOR_THEME | 3 | Color theme for the user. |

View File

@ -28,6 +28,8 @@ const (
UserSettingKey_USER_SETTING_ACCESS_TOKENS UserSettingKey = 1 UserSettingKey_USER_SETTING_ACCESS_TOKENS UserSettingKey = 1
// Locale for the user. // Locale for the user.
UserSettingKey_USER_SETTING_LOCALE UserSettingKey = 2 UserSettingKey_USER_SETTING_LOCALE UserSettingKey = 2
// Color theme for the user.
UserSettingKey_USER_SETTING_COLOR_THEME UserSettingKey = 3
) )
// Enum value maps for UserSettingKey. // Enum value maps for UserSettingKey.
@ -36,11 +38,13 @@ var (
0: "USER_SETTING_KEY_UNSPECIFIED", 0: "USER_SETTING_KEY_UNSPECIFIED",
1: "USER_SETTING_ACCESS_TOKENS", 1: "USER_SETTING_ACCESS_TOKENS",
2: "USER_SETTING_LOCALE", 2: "USER_SETTING_LOCALE",
3: "USER_SETTING_COLOR_THEME",
} }
UserSettingKey_value = map[string]int32{ UserSettingKey_value = map[string]int32{
"USER_SETTING_KEY_UNSPECIFIED": 0, "USER_SETTING_KEY_UNSPECIFIED": 0,
"USER_SETTING_ACCESS_TOKENS": 1, "USER_SETTING_ACCESS_TOKENS": 1,
"USER_SETTING_LOCALE": 2, "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} 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 { type UserSetting struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -131,6 +184,7 @@ type UserSetting struct {
// //
// *UserSetting_AccessTokens // *UserSetting_AccessTokens
// *UserSetting_Locale // *UserSetting_Locale
// *UserSetting_ColorTheme
Value isUserSetting_Value `protobuf_oneof:"value"` Value isUserSetting_Value `protobuf_oneof:"value"`
} }
@ -201,6 +255,13 @@ func (x *UserSetting) GetLocale() LocaleUserSetting {
return LocaleUserSetting_LOCALE_USER_SETTING_UNSPECIFIED 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 { type isUserSetting_Value interface {
isUserSetting_Value() isUserSetting_Value()
} }
@ -213,10 +274,16 @@ type UserSetting_Locale struct {
Locale LocaleUserSetting `protobuf:"varint,4,opt,name=locale,proto3,enum=slash.store.LocaleUserSetting,oneof"` 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_AccessTokens) isUserSetting_Value() {}
func (*UserSetting_Locale) isUserSetting_Value() {} func (*UserSetting_Locale) isUserSetting_Value() {}
func (*UserSetting_ColorTheme) isUserSetting_Value() {}
type AccessTokensUserSetting struct { type AccessTokensUserSetting struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -327,7 +394,7 @@ var File_store_user_setting_proto protoreflect.FileDescriptor
var file_store_user_setting_proto_rawDesc = []byte{ var file_store_user_setting_proto_rawDesc = []byte{
0x0a, 0x18, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x73, 0x65, 0x74, 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, 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, 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, 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, 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, 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, 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, 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, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x45, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f,
0xc4, 0x01, 0x0a, 0x17, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x74, 0x68, 0x65, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x22, 0x2e, 0x73, 0x6c,
0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x55, 0x0a, 0x0d, 0x61, 0x61, 0x73, 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54,
0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x68, 0x65, 0x6d, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x48,
0x28, 0x0b, 0x32, 0x30, 0x2e, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x00, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x68, 0x65, 0x6d, 0x65, 0x42, 0x07, 0x0a,
0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x55, 0x73, 0x65, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xc4, 0x01, 0x0a, 0x17, 0x41, 0x63, 0x63, 0x65, 0x73,
0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69,
0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x67, 0x12, 0x55, 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b,
0x6e, 0x73, 0x1a, 0x52, 0x0a, 0x0b, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x65, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x73, 0x6c, 0x61, 0x73,
0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f,
0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6b, 0x65, 0x6e, 0x73, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x2e,
0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0c, 0x61, 0x63, 0x63,
0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x1a, 0x52, 0x0a, 0x0b, 0x41, 0x63, 0x63,
0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x6b, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65,
0x74, 0x74, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x20, 0x0a, 0x1c, 0x55, 0x53, 0x45, 0x52, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b,
0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64,
0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x55, 0x53, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x89, 0x01,
0x53, 0x5f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x53, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x55, 0x53, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79,
0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x12, 0x20, 0x0a, 0x1c, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47,
0x45, 0x10, 0x02, 0x2a, 0x70, 0x0a, 0x11, 0x4c, 0x6f, 0x63, 0x61, 0x6c, 0x65, 0x55, 0x73, 0x65, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44,
0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x0a, 0x1f, 0x4c, 0x4f, 0x43, 0x41, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x1a, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49,
0x4c, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x4e, 0x47, 0x5f, 0x41, 0x43, 0x43, 0x45, 0x53, 0x53, 0x5f, 0x54, 0x4f, 0x4b, 0x45, 0x4e, 0x53,
0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49,
0x16, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x4e, 0x47, 0x5f, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x55,
0x54, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x4e, 0x10, 0x01, 0x12, 0x1a, 0x0a, 0x16, 0x4c, 0x4f, 0x43, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x43, 0x4f, 0x4c, 0x4f,
0x41, 0x4c, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x52, 0x5f, 0x54, 0x48, 0x45, 0x4d, 0x45, 0x10, 0x03, 0x2a, 0x70, 0x0a, 0x11, 0x4c, 0x6f, 0x63,
0x5f, 0x5a, 0x48, 0x10, 0x02, 0x42, 0x9a, 0x01, 0x0a, 0x0f, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x6c, 0x61, 0x6c, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x23,
0x61, 0x73, 0x68, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x42, 0x10, 0x55, 0x73, 0x65, 0x72, 0x53, 0x0a, 0x1f, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45,
0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x67, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x6f, 0x6f, 0x6a, 0x61, 0x63, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x55, 0x53,
0x6b, 0x2f, 0x73, 0x6c, 0x61, 0x73, 0x68, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x65, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x45, 0x4e, 0x10, 0x01, 0x12,
0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0xa2, 0x02, 0x03, 0x53, 0x53, 0x58, 0xaa, 0x02, 0x0b, 0x1a, 0x0a, 0x16, 0x4c, 0x4f, 0x43, 0x41, 0x4c, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53,
0x53, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xca, 0x02, 0x0b, 0x53, 0x6c, 0x45, 0x54, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x5a, 0x48, 0x10, 0x02, 0x2a, 0x88, 0x01, 0x0a, 0x15,
0x61, 0x73, 0x68, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0xe2, 0x02, 0x17, 0x53, 0x6c, 0x61, 0x73, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x54, 0x68, 0x65, 0x6d, 0x65, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65,
0x68, 0x5c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x28, 0x0a, 0x24, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x5f, 0x54,
0x61, 0x74, 0x61, 0xea, 0x02, 0x0c, 0x53, 0x6c, 0x61, 0x73, 0x68, 0x3a, 0x3a, 0x53, 0x74, 0x6f, 0x48, 0x45, 0x4d, 0x45, 0x5f, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x53, 0x45, 0x54, 0x54, 0x49, 0x4e,
0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 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 ( var (
@ -393,25 +475,27 @@ func file_store_user_setting_proto_rawDescGZIP() []byte {
return file_store_user_setting_proto_rawDescData 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_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_store_user_setting_proto_goTypes = []interface{}{ var file_store_user_setting_proto_goTypes = []interface{}{
(UserSettingKey)(0), // 0: slash.store.UserSettingKey (UserSettingKey)(0), // 0: slash.store.UserSettingKey
(LocaleUserSetting)(0), // 1: slash.store.LocaleUserSetting (LocaleUserSetting)(0), // 1: slash.store.LocaleUserSetting
(*UserSetting)(nil), // 2: slash.store.UserSetting (ColorThemeUserSetting)(0), // 2: slash.store.ColorThemeUserSetting
(*AccessTokensUserSetting)(nil), // 3: slash.store.AccessTokensUserSetting (*UserSetting)(nil), // 3: slash.store.UserSetting
(*AccessTokensUserSetting_AccessToken)(nil), // 4: slash.store.AccessTokensUserSetting.AccessToken (*AccessTokensUserSetting)(nil), // 4: slash.store.AccessTokensUserSetting
(*AccessTokensUserSetting_AccessToken)(nil), // 5: slash.store.AccessTokensUserSetting.AccessToken
} }
var file_store_user_setting_proto_depIdxs = []int32{ var file_store_user_setting_proto_depIdxs = []int32{
0, // 0: slash.store.UserSetting.key:type_name -> slash.store.UserSettingKey 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 1, // 2: slash.store.UserSetting.locale:type_name -> slash.store.LocaleUserSetting
4, // 3: slash.store.AccessTokensUserSetting.access_tokens:type_name -> slash.store.AccessTokensUserSetting.AccessToken 2, // 3: slash.store.UserSetting.color_theme:type_name -> slash.store.ColorThemeUserSetting
4, // [4:4] is the sub-list for method output_type 5, // 4: slash.store.AccessTokensUserSetting.access_tokens:type_name -> slash.store.AccessTokensUserSetting.AccessToken
4, // [4:4] is the sub-list for method input_type 5, // [5:5] is the sub-list for method output_type
4, // [4:4] is the sub-list for extension type_name 5, // [5:5] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension extendee 5, // [5:5] is the sub-list for extension type_name
0, // [0:4] is the sub-list for field 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() } 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{}{ file_store_user_setting_proto_msgTypes[0].OneofWrappers = []interface{}{
(*UserSetting_AccessTokens)(nil), (*UserSetting_AccessTokens)(nil),
(*UserSetting_Locale)(nil), (*UserSetting_Locale)(nil),
(*UserSetting_ColorTheme)(nil),
} }
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_store_user_setting_proto_rawDesc, RawDescriptor: file_store_user_setting_proto_rawDesc,
NumEnums: 2, NumEnums: 3,
NumMessages: 3, NumMessages: 3,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,

View File

@ -13,6 +13,8 @@ message UserSetting {
AccessTokensUserSetting access_tokens = 3; AccessTokensUserSetting access_tokens = 3;
LocaleUserSetting locale = 4; LocaleUserSetting locale = 4;
ColorThemeUserSetting color_theme = 5;
} }
} }
@ -22,6 +24,8 @@ enum UserSettingKey {
USER_SETTING_ACCESS_TOKENS = 1; USER_SETTING_ACCESS_TOKENS = 1;
// Locale for the user. // Locale for the user.
USER_SETTING_LOCALE = 2; USER_SETTING_LOCALE = 2;
// Color theme for the user.
USER_SETTING_COLOR_THEME = 3;
} }
message AccessTokensUserSetting { message AccessTokensUserSetting {
@ -40,3 +44,9 @@ enum LocaleUserSetting {
LOCALE_USER_SETTING_EN = 1; LOCALE_USER_SETTING_EN = 1;
LOCALE_USER_SETTING_ZH = 2; 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;
}

View File

@ -33,6 +33,8 @@ func (s *Store) UpsertUserSetting(ctx context.Context, upsert *storepb.UserSetti
valueString = string(valueBytes) valueString = string(valueBytes)
} else if upsert.Key == storepb.UserSettingKey_USER_SETTING_LOCALE { } else if upsert.Key == storepb.UserSettingKey_USER_SETTING_LOCALE {
valueString = upsert.GetLocale().String() valueString = upsert.GetLocale().String()
} else if upsert.Key == storepb.UserSettingKey_USER_SETTING_COLOR_THEME {
valueString = upsert.GetColorTheme().String()
} else { } else {
return nil, errors.New("invalid user setting key") 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{ userSetting.Value = &storepb.UserSetting_Locale{
Locale: convertUserSettingLocaleFromString(valueString), Locale: convertUserSettingLocaleFromString(valueString),
} }
} else if userSetting.Key == storepb.UserSettingKey_USER_SETTING_COLOR_THEME {
userSetting.Value = &storepb.UserSetting_ColorTheme{
ColorTheme: convertUserSettingColorThemeFromString(valueString),
}
} else { } else {
return nil, errors.New("invalid user setting key") 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 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
}
}

View File

@ -94,4 +94,26 @@ func TestUserSettingStore(t *testing.T) {
}) })
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, storepb.LocaleUserSetting_LOCALE_USER_SETTING_EN, localeUserSetting.GetLocale()) 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())
} }