add roles routes

This commit is contained in:
2026-07-06 23:32:38 +07:00
parent 728fcc6fda
commit 82ffda5c0a
9 changed files with 1029 additions and 39 deletions
+47
View File
@@ -110,11 +110,31 @@ service EveningDetectiveServer {
};
}
rpc GetUserById(GetUserByIdReq) returns (GetUserByIdRsp) {
option (google.api.http) = {
get: "/api/users/{id}"
};
}
rpc GetMe(GetMeReq) returns (GetMeRsp) {
option (google.api.http) = {
get: "/api/me"
};
}
rpc AddUserRole(AddUserRoleReq) returns (AddUserRoleRsp) {
option (google.api.http) = {
post: "/api/users/{id}/role/add"
body: "*"
};
}
rpc DeleteUserRole(DeleteUserRoleReq) returns (DeleteUserRoleRsp) {
option (google.api.http) = {
post: "/api/users/{id}/role/delete"
body : "*"
};
}
}
message PingReq {}
@@ -183,9 +203,36 @@ message User {
google.protobuf.Timestamp created_at = 6;
}
message GetUserByIdReq {
int32 id = 1;
}
message GetUserByIdRsp {
string error = 1;
User user = 2;
}
message GetMeReq {}
message GetMeRsp {
string error = 1;
User user = 2;
}
message AddUserRoleReq {
int32 id = 1;
string role = 2;
}
message AddUserRoleRsp {
string error = 1;
}
message DeleteUserRoleReq {
int32 id = 1;
string role = 2;
}
message DeleteUserRoleRsp {
string error = 1;
}