mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-21 06:13:33 +00:00
63 lines
1.4 KiB
Protocol Buffer
63 lines
1.4 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package slash.api.v2;
|
|
|
|
import "google/api/annotations.proto";
|
|
import "google/api/client.proto";
|
|
import "google/protobuf/field_mask.proto";
|
|
|
|
option go_package = "gen/api/v2";
|
|
|
|
service UserSettingService {
|
|
// GetUserSetting returns the user setting.
|
|
rpc GetUserSetting(GetUserSettingRequest) returns (GetUserSettingResponse) {
|
|
option (google.api.http) = {get: "/api/v2/users/{id}/settings"};
|
|
option (google.api.method_signature) = "id";
|
|
}
|
|
// UpdateUserSetting updates the user setting.
|
|
rpc UpdateUserSetting(UpdateUserSettingRequest) returns (UpdateUserSettingResponse) {
|
|
option (google.api.http) = {
|
|
put: "/api/v2/users/{id}/settings"
|
|
body: "*"
|
|
};
|
|
option (google.api.method_signature) = "id";
|
|
}
|
|
}
|
|
|
|
message UserSetting {
|
|
// id is the user id.
|
|
int32 id = 1;
|
|
|
|
enum Locale {
|
|
LOCALE_UNSPECIFIED = 0;
|
|
LOCALE_EN = 1;
|
|
LOCALE_ZH = 2;
|
|
}
|
|
// locale is the user locale.
|
|
Locale locale = 2;
|
|
}
|
|
|
|
message GetUserSettingRequest {
|
|
// id is the user id.
|
|
int32 id = 1;
|
|
}
|
|
|
|
message GetUserSettingResponse {
|
|
UserSetting user_setting = 1;
|
|
}
|
|
|
|
message UpdateUserSettingRequest {
|
|
// id is the user id.
|
|
int32 id = 1;
|
|
|
|
// user_setting is the user setting to update.
|
|
UserSetting user_setting = 2;
|
|
|
|
// update_mask is the field mask to update the user setting.
|
|
google.protobuf.FieldMask update_mask = 3;
|
|
}
|
|
|
|
message UpdateUserSettingResponse {
|
|
UserSetting user_setting = 1;
|
|
}
|