diff --git a/app/src/app/api/minio/route.ts b/app/src/app/api/minio/route.ts index 958a5f9..8e1f085 100644 --- a/app/src/app/api/minio/route.ts +++ b/app/src/app/api/minio/route.ts @@ -115,11 +115,21 @@ export async function POST(req: NextRequest) { const score = await scoreRegister(scoreData, assignmentId); + const japaneseText = await prisma.word.findFirst({ + where: { + english: assignment, + }, + select: { + japanese: true, + }, + }); + const response: ScoreResponse = { text: caption || "", score: score?.point || 0, similarity: resSimilarity.similarity, assignmentId: assignmentId, + japaneseText: japaneseText?.japanese || "", }; return new Response(JSON.stringify(response), { diff --git a/app/src/app/camera/page.tsx b/app/src/app/camera/page.tsx index 5e199b1..0bf7ee2 100644 --- a/app/src/app/camera/page.tsx +++ b/app/src/app/camera/page.tsx @@ -232,7 +232,7 @@ const CameraApp = () => { const percentSimilarity = Math.floor(data.similarity * 100); setMessage( - `キャプション: ${data.text} \n類似度: ${percentSimilarity}% スコア: ${data.score} \nランキングから順位を確認しましょう!`, + `生成文章: ${data.text} \n日本語: ${data.japaneseText} \n類似度: ${percentSimilarity}% スコア: ${data.score} \nランキングから順位を確認しましょう!`, ); const newAssignments = assignments.map((assignment) => { if (assignment.assignmentId === data.assignmentId) { diff --git a/app/src/types/index.tsx b/app/src/types/index.tsx index bbd2d18..d5e2d94 100644 --- a/app/src/types/index.tsx +++ b/app/src/types/index.tsx @@ -135,6 +135,7 @@ export interface ScoreResponse { score: number; similarity: number; assignmentId: number; + japaneseText: string; } export interface ChangeStatus {