Merged PR 70: API I/F実装(メール認証)

## 概要
[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の生成を確認
This commit is contained in:
湯本 開 2023-04-12 04:36:20 +00:00
parent f75b8545b1
commit 6a5926ab3f
2 changed files with 66 additions and 0 deletions

View File

@ -172,6 +172,48 @@
"tags": ["users"] "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": { "/users": {
"get": { "get": {
"operationId": "getUsers", "operationId": "getUsers",

View File

@ -43,6 +43,30 @@ export class UsersController {
return {}; 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<ConfirmResponse> {
console.log(body);
return {};
}
@ApiResponse({ @ApiResponse({
status: HttpStatus.OK, status: HttpStatus.OK,
type: GetUsersResponse, type: GetUsersResponse,