add change password

This commit is contained in:
2026-09-09 18:53:08 +07:00
parent 4feece62c8
commit 0fb4a6f37b
10 changed files with 1161 additions and 598 deletions
+28 -7
View File
@@ -186,6 +186,20 @@ service EveningDetectiveServer {
};
}
// Только администратор; сеансы пользователя сохраняются.
// Ошибки: 401, 403, 400, 404, 500.
rpc ChangeUserPassword(ChangeUserPasswordReq) returns (ChangeUserPasswordRsp) {
option (google.api.http) = {
post: "/api/users/{id}/password"
body: "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags : "Пользователи";
summary : "Изменить чужой пароль (только администратор)";
description: "Пароль вводится вручную: минимум 12 символов, максимум 72 байта. Сеансы сохраняются. Ошибки: 401 — нет авторизации, 403 — нет прав, 400 — неверные данные или собственный ID, 404 — пользователь не найден, 500 — ошибка сохранения.";
};
}
rpc AddUserRole(AddUserRoleReq) returns (AddUserRoleRsp) {
option (google.api.http) = {
post: "/api/users/{id}/role/add"
@@ -423,11 +437,11 @@ service EveningDetectiveServer {
// Видео загружается через UploadFile (MP4/WebM). Пустая conclusion удаляет закрывашку.
rpc UpdateScenarioConclusion(UpdateScenarioConclusionReq) returns (UpdateScenarioConclusionRsp) {
option (google.api.http) = {
put: "/api/scenarios/{id}/conclusion"
put : "/api/scenarios/{id}/conclusion"
body: "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
tags: "Сценарии";
tags : "Сценарии";
summary: "Обновить закрывашку сценария (игрокам не передаётся)";
};
}
@@ -826,6 +840,13 @@ message GetMeRsp {
User user = 2;
}
message ChangeUserPasswordReq {
int32 id = 1;
string new_password = 2;
}
message ChangeUserPasswordRsp {}
message AddUserRoleReq {
int32 id = 1;
string role = 2;
@@ -922,7 +943,7 @@ message Story {
}
message Conclusion {
string text = 1;
string text = 1;
string video = 2;
}
@@ -1062,7 +1083,7 @@ message DeleteScenarioPlaceRsp {
}
message UpdateScenarioConclusionReq {
int32 id = 1;
int32 id = 1;
Conclusion conclusion = 2;
}
@@ -1309,9 +1330,9 @@ message GetTeamStoryReq {
}
message GetTeamStoryRsp {
string error = 1;
Story story = 2;
Game game = 3;
string error = 1;
Story story = 2;
Game game = 3;
repeated TeamAction actions = 4;
}