diff --git a/dictation_server/src/api/odms/openapi.json b/dictation_server/src/api/odms/openapi.json index 4ab6f02..8c597b0 100644 --- a/dictation_server/src/api/odms/openapi.json +++ b/dictation_server/src/api/odms/openapi.json @@ -474,7 +474,12 @@ } } }, - "tags": ["files"] + "tags": ["files"], + "security": [ + { + "bearer": [] + } + ] } }, "/files/audio/upload-location": { @@ -550,6 +555,16 @@ } } }, + "400": { + "description": "不正なパラメータ", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "401": { "description": "認証エラー", "content": { @@ -606,6 +621,16 @@ } } }, + "400": { + "description": "不正なパラメータ", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "401": { "description": "認証エラー", "content": { @@ -639,7 +664,7 @@ "get": { "operationId": "getTasks", "summary": "", - "description": "音声ファイル・文字起こしタスク情報をページ指定して取得します。", + "description": "音声ファイル・文字起こしタスク情報をページ指定して取得します", "parameters": [ { "name": "limit", @@ -673,6 +698,16 @@ } } }, + "400": { + "description": "不正なパラメータ", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "401": { "description": "認証エラー", "content": { @@ -729,6 +764,16 @@ } } }, + "400": { + "description": "不正なパラメータ", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "401": { "description": "認証エラー", "content": { @@ -785,6 +830,16 @@ } } }, + "400": { + "description": "不正なパラメータ", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "401": { "description": "認証エラー", "content": { @@ -851,6 +906,16 @@ } } }, + "400": { + "description": "不正なパラメータ", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "401": { "description": "認証エラー", "content": { @@ -917,6 +982,16 @@ } } }, + "400": { + "description": "不正なパラメータ", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "401": { "description": "認証エラー", "content": { @@ -983,6 +1058,16 @@ } } }, + "400": { + "description": "不正なパラメータ", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "401": { "description": "認証エラー", "content": { @@ -1049,6 +1134,16 @@ } } }, + "400": { + "description": "不正なパラメータ", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "401": { "description": "認証エラー", "content": { @@ -1115,6 +1210,16 @@ } } }, + "400": { + "description": "不正なパラメータ", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, "401": { "description": "認証エラー", "content": { @@ -1154,71 +1259,6 @@ ] } }, - "/notification/register": { - "post": { - "operationId": "register", - "summary": "", - "parameters": [], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RegisterRequest" - } - } - } - }, - "responses": { - "200": { - "description": "成功時のレスポンス", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/RegisterResponse" - } - } - } - }, - "400": { - "description": "不正なパラメータ", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "401": { - "description": "認証エラー", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - }, - "500": { - "description": "想定外のサーバーエラー", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ErrorResponse" - } - } - } - } - }, - "tags": ["notification"], - "security": [ - { - "bearer": [] - } - ] - } - }, "/licenses/orders": { "post": { "operationId": "createOrders", @@ -1283,6 +1323,71 @@ } ] } + }, + "/notification/register": { + "post": { + "operationId": "register", + "summary": "", + "parameters": [], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RegisterRequest" + } + } + } + }, + "responses": { + "200": { + "description": "成功時のレスポンス", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RegisterResponse" + } + } + } + }, + "400": { + "description": "不正なパラメータ", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "401": { + "description": "認証エラー", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + }, + "500": { + "description": "想定外のサーバーエラー", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ErrorResponse" + } + } + } + } + }, + "tags": ["notification"], + "security": [ + { + "bearer": [] + } + ] + } } }, "info": { @@ -1915,6 +2020,22 @@ "type": "object", "properties": {} }, + "CreateOrdersRequest": { + "type": "object", + "properties": { + "poNumber": { + "type": "string" + }, + "orderCount": { + "type": "number" + } + }, + "required": ["poNumber", "orderCount"] + }, + "CreateOrdersResponse": { + "type": "object", + "properties": {} + }, "RegisterRequest": { "type": "object", "properties": { @@ -1932,22 +2053,6 @@ "RegisterResponse": { "type": "object", "properties": {} - }, - "CreateOrdersRequest": { - "type": "object", - "properties": { - "poNumber": { - "type": "string" - }, - "orderCount": { - "type": "number" - } - }, - "required": ["poNumber", "orderCount"] - }, - "CreateOrdersResponse": { - "type": "object", - "properties": {} } } } diff --git a/dictation_server/src/features/files/files.controller.ts b/dictation_server/src/features/files/files.controller.ts index ba4873d..d88dbfa 100644 --- a/dictation_server/src/features/files/files.controller.ts +++ b/dictation_server/src/features/files/files.controller.ts @@ -56,8 +56,10 @@ export class FilesController { description: 'アップロードが完了した音声ファイルの情報を登録し、文字起こしタスクを生成します', }) + @ApiBearerAuth() @Post('audio/upload-finished') async uploadFinished( + @Headers() headers, @Body() body: AudioUploadFinishedRequest, ): Promise { console.log(body); @@ -103,6 +105,11 @@ export class FilesController { type: AudioDownloadLocationResponse, description: '成功時のレスポンス', }) + @ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: '不正なパラメータ', + type: ErrorResponse, + }) @ApiResponse({ status: HttpStatus.UNAUTHORIZED, description: '認証エラー', @@ -137,6 +144,11 @@ export class FilesController { type: TemplateDownloadLocationResponse, description: '成功時のレスポンス', }) + @ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: '不正なパラメータ', + type: ErrorResponse, + }) @ApiResponse({ status: HttpStatus.UNAUTHORIZED, description: '認証エラー', diff --git a/dictation_server/src/features/tasks/tasks.controller.ts b/dictation_server/src/features/tasks/tasks.controller.ts index 87ea84b..598fab4 100644 --- a/dictation_server/src/features/tasks/tasks.controller.ts +++ b/dictation_server/src/features/tasks/tasks.controller.ts @@ -34,6 +34,11 @@ export class TasksController { type: TasksResponse, description: '成功時のレスポンス', }) + @ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: '不正なパラメータ', + type: ErrorResponse, + }) @ApiResponse({ status: HttpStatus.UNAUTHORIZED, description: '認証エラー', @@ -46,8 +51,7 @@ export class TasksController { }) @ApiOperation({ operationId: 'getTasks', - description: - '音声ファイル・文字起こしタスク情報をページ指定して取得します。', + description: '音声ファイル・文字起こしタスク情報をページ指定して取得します', }) @ApiBearerAuth() @Get() @@ -71,6 +75,11 @@ export class TasksController { type: AudioNextResponse, description: '成功時のレスポンス', }) + @ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: '不正なパラメータ', + type: ErrorResponse, + }) @ApiResponse({ status: HttpStatus.UNAUTHORIZED, description: '認証エラー', @@ -103,6 +112,11 @@ export class TasksController { type: ChangeStatusResponse, description: '成功時のレスポンス', }) + @ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: '不正なパラメータ', + type: ErrorResponse, + }) @ApiResponse({ status: HttpStatus.NOT_FOUND, description: '指定したIDの音声ファイルが存在しない場合', @@ -140,6 +154,11 @@ export class TasksController { type: ChangeStatusResponse, description: '成功時のレスポンス', }) + @ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: '不正なパラメータ', + type: ErrorResponse, + }) @ApiResponse({ status: HttpStatus.NOT_FOUND, description: '指定したIDの音声ファイルが存在しない場合', @@ -177,6 +196,11 @@ export class TasksController { type: ChangeStatusResponse, description: '成功時のレスポンス', }) + @ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: '不正なパラメータ', + type: ErrorResponse, + }) @ApiResponse({ status: HttpStatus.NOT_FOUND, description: '指定したIDの音声ファイルが存在しない場合', @@ -214,6 +238,11 @@ export class TasksController { type: ChangeStatusResponse, description: '成功時のレスポンス', }) + @ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: '不正なパラメータ', + type: ErrorResponse, + }) @ApiResponse({ status: HttpStatus.NOT_FOUND, description: '指定したIDの音声ファイルが存在しない場合', @@ -251,6 +280,11 @@ export class TasksController { type: ChangeStatusResponse, description: '成功時のレスポンス', }) + @ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: '不正なパラメータ', + type: ErrorResponse, + }) @ApiResponse({ status: HttpStatus.NOT_FOUND, description: '指定したIDの音声ファイルが存在しない場合', @@ -288,6 +322,11 @@ export class TasksController { type: ChangeStatusResponse, description: '成功時のレスポンス', }) + @ApiResponse({ + status: HttpStatus.BAD_REQUEST, + description: '不正なパラメータ', + type: ErrorResponse, + }) @ApiResponse({ status: HttpStatus.NOT_FOUND, description: '指定したIDの音声ファイルが存在しない場合',