From 6a5926ab3f1f92286d3edc6ec4accaa347c4eb88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B9=AF=E6=9C=AC=20=E9=96=8B?= Date: Wed, 12 Apr 2023 04:36:20 +0000 Subject: [PATCH] =?UTF-8?q?Merged=20PR=2070:=20API=20I/F=E5=AE=9F=E8=A3=85?= =?UTF-8?q?=EF=BC=88=E3=83=A1=E3=83=BC=E3=83=AB=E8=AA=8D=E8=A8=BC=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task1599: API I/F実装(メール認証)](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/1599) - エンドユーザーのメール認証を行うAPIのI/Fを作成 ## レビューポイント - pathは問題なさそうか - Request/Responseは本質的に同一だと思われるため、管理者の認証と共通としたが問題ないか? ## 動作確認状況 - openapi.jsonの生成を確認 --- dictation_server/src/api/odms/openapi.json | 42 +++++++++++++++++++ .../src/features/users/users.controller.ts | 24 +++++++++++ 2 files changed, 66 insertions(+) diff --git a/dictation_server/src/api/odms/openapi.json b/dictation_server/src/api/odms/openapi.json index c9c6b22..60460a3 100644 --- a/dictation_server/src/api/odms/openapi.json +++ b/dictation_server/src/api/odms/openapi.json @@ -172,6 +172,48 @@ "tags": ["users"] } }, + "/users/confirm/initpassword": { + "post": { + "operationId": "confirmUserAndInitPassword", + "summary": "", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ConfirmRequest" } + } + } + }, + "responses": { + "200": { + "description": "成功時のレスポンス", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ConfirmResponse" } + } + } + }, + "400": { + "description": "不正なトークン", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorResponse" } + } + } + }, + "500": { + "description": "想定外のサーバーエラー", + "content": { + "application/json": { + "schema": { "$ref": "#/components/schemas/ErrorResponse" } + } + } + } + }, + "tags": ["users"] + } + }, "/users": { "get": { "operationId": "getUsers", diff --git a/dictation_server/src/features/users/users.controller.ts b/dictation_server/src/features/users/users.controller.ts index 0bbc043..b696aa1 100644 --- a/dictation_server/src/features/users/users.controller.ts +++ b/dictation_server/src/features/users/users.controller.ts @@ -43,6 +43,30 @@ export class UsersController { return {}; } + @ApiResponse({ + status: HttpStatus.OK, + type: ConfirmResponse, + description: '成功時のレスポンス', + }) + @ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: '不正なトークン', + type: ErrorResponse, + }) + @ApiResponse({ + status: HttpStatus.INTERNAL_SERVER_ERROR, + description: '想定外のサーバーエラー', + type: ErrorResponse, + }) + @ApiOperation({ operationId: 'confirmUserAndInitPassword' }) + @Post('confirm/initpassword') + async confirmUserAndInitPassword( + @Body() body: ConfirmRequest, + ): Promise { + console.log(body); + return {}; + } + @ApiResponse({ status: HttpStatus.OK, type: GetUsersResponse,