chore(api)!: refactored grpc API
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
syntax = "proto3";
|
||||
package user;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
option go_package = "pkg/api/user";
|
||||
|
||||
service UserService {
|
||||
rpc GetProfile(GetProfileRequest) returns (User);
|
||||
rpc RegisterForCompetition(RegisterForCompetitionRequest) returns (google.protobuf.Empty);
|
||||
rpc UnregisterFromCompetition(UnregisterFromCompetitionRequest) returns (google.protobuf.Empty);
|
||||
rpc ListUserCompetitions(ListUserCompetitionsRequest) returns (ListUserCompetitionsResponse);
|
||||
}
|
||||
|
||||
message User {
|
||||
string id = 1;
|
||||
string username = 2;
|
||||
string email = 3;
|
||||
optional string full_name = 4;
|
||||
optional string avatar_url = 5;
|
||||
}
|
||||
|
||||
message GetProfileRequest {
|
||||
string user_id = 1;
|
||||
}
|
||||
|
||||
message RegisterForCompetitionRequest {
|
||||
string competition_id = 1;
|
||||
}
|
||||
message UnregisterFromCompetitionRequest {
|
||||
string competition_id = 1;
|
||||
}
|
||||
|
||||
message ListUserCompetitionsRequest {
|
||||
string user_id = 1;
|
||||
}
|
||||
message ListUserCompetitionsResponse {
|
||||
repeated string competition_ids = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user