From 8ccc2a82e8caac3bc8b6f3678f09769a98211d6e Mon Sep 17 00:00:00 2001 From: "makabe.t" Date: Tue, 9 May 2023 06:16:44 +0000 Subject: [PATCH] =?UTF-8?q?Merged=20PR=2092:=20OptionItem=E5=AF=BE?= =?UTF-8?q?=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task1701: OptionItem対応](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/1701) - 以下のAPIでOptionItemを配列で持つように修正しました。 - 音声ファイルアップロード完了API - タスク情報取得API ## レビューポイント - 対応箇所に過不足はないか - 対応内容として適切か ## UIの変更 無し ## 動作確認状況 - ローカルでSwagger確認 --- dictation_server/src/api/odms/openapi.json | 56 +++++++++++-------- .../src/features/files/types/types.ts | 18 ++++-- .../src/features/tasks/types/types.ts | 12 ++-- 3 files changed, 56 insertions(+), 30 deletions(-) diff --git a/dictation_server/src/api/odms/openapi.json b/dictation_server/src/api/odms/openapi.json index 4f47b53..4326ad3 100644 --- a/dictation_server/src/api/odms/openapi.json +++ b/dictation_server/src/api/odms/openapi.json @@ -1530,6 +1530,22 @@ "prompt" ] }, + "AudioOptionItem": { + "type": "object", + "properties": { + "optionItemLabel": { + "type": "string", + "minLength": 1, + "maxLength": 16 + }, + "optionItemValue": { + "type": "string", + "minLength": 1, + "maxLength": 20 + } + }, + "required": ["optionItemLabel", "optionItemValue"] + }, "AudioUploadFinishedRequest": { "type": "object", "properties": { @@ -1578,15 +1594,14 @@ "workType": { "type": "string" }, - "optionItemLabel": { - "type": "string", - "minLength": 1, - "maxLength": 16 - }, - "optionItemValue": { - "type": "string", - "minLength": 1, - "maxLength": 20 + "optionItemList": { + "maxItems": 10, + "minItems": 10, + "description": "音声ファイルに紐づくOption Itemの一覧(10個固定)", + "type": "array", + "items": { + "$ref": "#/components/schemas/AudioOptionItem" + } }, "isEncrypted": { "type": "boolean" @@ -1605,8 +1620,7 @@ "audioFormat", "comment", "workType", - "optionItemLabel", - "optionItemValue", + "optionItemList", "isEncrypted" ] }, @@ -1681,15 +1695,14 @@ "workType": { "type": "string" }, - "optionItemLabel": { - "type": "string", - "minLength": 1, - "maxLength": 16 - }, - "optionItemValue": { - "type": "string", - "minLength": 1, - "maxLength": 20 + "optionItemList": { + "maxItems": 10, + "minItems": 10, + "description": "音声ファイルに紐づくOption Itemの一覧(10個固定)", + "type": "array", + "items": { + "$ref": "#/components/schemas/AudioOptionItem" + } }, "url": { "type": "string", @@ -1770,8 +1783,7 @@ "audioFileId", "authorId", "workType", - "optionItemLabel", - "optionItemValue", + "optionItemList", "url", "fileName", "audioDuration", diff --git a/dictation_server/src/features/files/types/types.ts b/dictation_server/src/features/files/types/types.ts index 872cb65..aad7373 100644 --- a/dictation_server/src/features/files/types/types.ts +++ b/dictation_server/src/features/files/types/types.ts @@ -31,6 +31,13 @@ export class TemplateDownloadLocationResponse { url: string; } +export class AudioOptionItem { + @ApiProperty({ minLength: 1, maxLength: 16 }) + optionItemLabel: string; + @ApiProperty({ minLength: 1, maxLength: 20 }) + optionItemValue: string; +} + export class AudioUploadFinishedRequest { @ApiProperty({ description: 'アップロード先Blob Storage(ファイル名含む)' }) url: string; @@ -65,10 +72,13 @@ export class AudioUploadFinishedRequest { comment: string; @ApiProperty() workType: string; - @ApiProperty({ minLength: 1, maxLength: 16 }) - optionItemLabel: string; - @ApiProperty({ minLength: 1, maxLength: 20 }) - optionItemValue: string; + @ApiProperty({ + type: [AudioOptionItem], + maxItems: 10, + minItems: 10, + description: '音声ファイルに紐づくOption Itemの一覧(10個固定)', + }) + optionItemList: AudioOptionItem[]; @ApiProperty() isEncrypted: boolean; } diff --git a/dictation_server/src/features/tasks/types/types.ts b/dictation_server/src/features/tasks/types/types.ts index 4516647..3f87b39 100644 --- a/dictation_server/src/features/tasks/types/types.ts +++ b/dictation_server/src/features/tasks/types/types.ts @@ -1,4 +1,5 @@ import { ApiProperty } from '@nestjs/swagger'; +import { AudioOptionItem } from '../../../features/files/types/types'; export class TasksRequest { @ApiProperty({ @@ -38,10 +39,13 @@ export class Task { authorId: string; @ApiProperty() workType: string; - @ApiProperty({ minLength: 1, maxLength: 16 }) - optionItemLabel: string; - @ApiProperty({ minLength: 1, maxLength: 20 }) - optionItemValue: string; + @ApiProperty({ + type: [AudioOptionItem], + maxItems: 10, + minItems: 10, + description: '音声ファイルに紐づくOption Itemの一覧(10個固定)', + }) + optionItemList: AudioOptionItem[]; @ApiProperty({ description: '音声ファイルのBlob Storage上での保存場所(ファイル名含む)のURL',