mirror of
https://github.com/Alexander-D-Karpov/concord.git
synced 2026-03-16 22:04:15 +03:00
130 lines
2.9 KiB
Protocol Buffer
130 lines
2.9 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package concord.users.v1;
|
|
|
|
option go_package = "github.com/Alexander-D-Karpov/concord/api/gen/go/users/v1;usersv1";
|
|
|
|
import "google/api/annotations.proto";
|
|
import "common/v1/types.proto";
|
|
|
|
message GetSelfRequest {}
|
|
|
|
message GetUserRequest {
|
|
string user_id = 1;
|
|
}
|
|
|
|
message GetUserByHandleRequest {
|
|
string handle = 1;
|
|
}
|
|
|
|
message UpdateProfileRequest {
|
|
string display_name = 1;
|
|
string avatar_url = 2;
|
|
string bio = 3;
|
|
}
|
|
|
|
message UpdateStatusRequest {
|
|
string status = 1;
|
|
}
|
|
|
|
message SearchUsersRequest {
|
|
string query = 1;
|
|
int32 limit = 2;
|
|
string cursor = 3;
|
|
}
|
|
|
|
message SearchUsersResponse {
|
|
repeated concord.common.v1.User users = 1;
|
|
string next_cursor = 2;
|
|
bool has_more = 3;
|
|
}
|
|
|
|
message ListUsersByIDsRequest {
|
|
repeated string user_ids = 1;
|
|
}
|
|
|
|
message ListUsersByIDsResponse {
|
|
repeated concord.common.v1.User users = 1;
|
|
}
|
|
|
|
message UploadAvatarRequest {
|
|
bytes image_data = 1;
|
|
string filename = 2;
|
|
}
|
|
|
|
message UploadAvatarResponse {
|
|
string avatar_url = 1;
|
|
string thumbnail_url = 2;
|
|
concord.common.v1.AvatarEntry avatar = 3;
|
|
}
|
|
|
|
message DeleteAvatarRequest {
|
|
string avatar_id = 1;
|
|
}
|
|
|
|
message DeleteAvatarResponse {}
|
|
|
|
message GetAvatarHistoryRequest {
|
|
string user_id = 1;
|
|
}
|
|
|
|
message GetAvatarHistoryResponse {
|
|
repeated concord.common.v1.AvatarEntry avatars = 1;
|
|
}
|
|
|
|
service UsersService {
|
|
rpc GetSelf(GetSelfRequest) returns (concord.common.v1.User) {
|
|
option (google.api.http) = {
|
|
get: "/v1/users/me"
|
|
};
|
|
}
|
|
rpc GetUser(GetUserRequest) returns (concord.common.v1.User) {
|
|
option (google.api.http) = {
|
|
get: "/v1/users/{user_id}"
|
|
};
|
|
}
|
|
rpc GetUserByHandle(GetUserByHandleRequest) returns (concord.common.v1.User) {
|
|
option (google.api.http) = {
|
|
get: "/v1/users/handle/{handle}"
|
|
};
|
|
}
|
|
rpc UpdateProfile(UpdateProfileRequest) returns (concord.common.v1.User) {
|
|
option (google.api.http) = {
|
|
patch: "/v1/users/me"
|
|
body: "*"
|
|
};
|
|
}
|
|
rpc UpdateStatus(UpdateStatusRequest) returns (concord.common.v1.User) {
|
|
option (google.api.http) = {
|
|
put: "/v1/users/me/status"
|
|
body: "*"
|
|
};
|
|
}
|
|
rpc SearchUsers(SearchUsersRequest) returns (SearchUsersResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v1/users/search"
|
|
};
|
|
}
|
|
rpc ListUsersByIDs(ListUsersByIDsRequest) returns (ListUsersByIDsResponse) {
|
|
option (google.api.http) = {
|
|
post: "/v1/users/batch"
|
|
body: "*"
|
|
};
|
|
}
|
|
rpc UploadAvatar(UploadAvatarRequest) returns (UploadAvatarResponse) {
|
|
option (google.api.http) = {
|
|
post: "/v1/users/me/avatar"
|
|
body: "*"
|
|
};
|
|
}
|
|
rpc DeleteAvatar(DeleteAvatarRequest) returns (DeleteAvatarResponse) {
|
|
option (google.api.http) = {
|
|
delete: "/v1/users/me/avatar/{avatar_id}"
|
|
};
|
|
}
|
|
rpc GetAvatarHistory(GetAvatarHistoryRequest) returns (GetAvatarHistoryResponse) {
|
|
option (google.api.http) = {
|
|
get: "/v1/users/{user_id}/avatars"
|
|
};
|
|
}
|
|
} |