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',