1- import  {  SendChatMessageRequest ,  SendChatMessageResponse  }  from  '@/chat/apis/sendChatMessage' ; 
2- import  {  NextRequest ,  NextResponse  }  from  'next/server' ; 
1+ import  { 
2+   SendChatMessageRequest , 
3+   SendChatMessageResponse , 
4+ }  from  "@/chat/apis/sendChatMessage" ; 
5+ import  {  NextRequest ,  NextResponse  }  from  "next/server" ; 
36
47export  async  function  POST ( request : NextRequest )  { 
58  const  body : SendChatMessageRequest  =  await  request . json ( ) ; 
@@ -8,51 +11,58 @@ export async function POST(request: NextRequest) {
811
912  const  normalReplyMockData : SendChatMessageResponse  =  { 
1013    messageId : 1 , 
11-     type : 'SYSTEM_NORMAL_REPLY' , 
12-     sender : 'SYSTEM' , 
13-     answers : [ '안녕 내담자' ,  '따듯한 마룻바닥이 그리운 겨울 밤이야' ,  '오늘은 어떤게 궁금해서 찾어왔어냥?' ] , 
14+     type : "SYSTEM_NORMAL_REPLY" , 
15+     sender : "SYSTEM" , 
16+     answers : [ 
17+       "안녕 내담자" , 
18+       "따듯한 마룻바닥이 그리운 겨울 밤이야" , 
19+       "오늘은 어떤게 궁금해서 찾어왔어냥?" , 
20+     ] , 
1421  } ; 
1522
1623  const  invalidQuestionReplyMockData : SendChatMessageResponse  =  { 
1724    messageId : 1 , 
18-     type : ' SYSTEM_INVALID_QUESTION_REPLY' , 
19-     sender : ' SYSTEM' , 
20-     answers : [ ' 잘못된 질문이네냥!' ,   ' 다시 질문해보라냥!' ] , 
25+     type : " SYSTEM_INVALID_QUESTION_REPLY" , 
26+     sender : " SYSTEM" , 
27+     answers : [ " 잘못된 질문이네냥!" ,   " 다시 질문해보라냥!" ] , 
2128  } ; 
2229
2330  const  questionReplyMockData : SendChatMessageResponse  =  { 
2431    messageId : 1 , 
25-     type : 'SYSTEM_TAROT_QUESTION_REPLY' , 
26-     sender : 'SYSTEM' , 
27-     answers : [ '전남친이 아직 미련이 남았는지 궁금하구낭!' ,  '타로카드로 그 사람의 마음을 함계 들여다 볼까냥?' ] , 
32+     type : "SYSTEM_TAROT_QUESTION_REPLY" , 
33+     sender : "SYSTEM" , 
34+     answers : [ 
35+       "전남친이 아직 미련이 남았는지 궁금하구낭!" , 
36+       "타로카드로 그 사람의 마음을 함계 들여다 볼까냥?" , 
37+     ] , 
2838  } ; 
2939
3040  const  questionAcceptanceReplyMockData : SendChatMessageResponse  =  { 
3141    messageId : 1 , 
32-     type : ' SYSTEM_TAROT_QUESTION_ACCEPTANCE_REPLY' , 
33-     sender : ' SYSTEM' , 
34-     answers : [ ' 너의 고민에 집중하면서' ,   ' 카드를 한 장 뽑아봐!' ] , 
42+     type : " SYSTEM_TAROT_QUESTION_ACCEPTANCE_REPLY" , 
43+     sender : " SYSTEM" , 
44+     answers : [ " 너의 고민에 집중하면서" ,   " 카드를 한 장 뽑아봐!" ] , 
3545  } ; 
3646
37-   if  ( body . intent  ===  ' NORMAL' )  { 
47+   if  ( body . intent  ===  " NORMAL" )  { 
3848    return  NextResponse . json ( {  data : normalReplyMockData  } ) ; 
3949  } 
4050
41-   if  ( body . intent  ===  ' TAROT_ACCEPT' )  { 
51+   if  ( body . intent  ===  " TAROT_ACCEPT" )  { 
4252    if  ( Math . random ( )  <  0.2 )  { 
4353      return  NextResponse . json ( {  data : invalidQuestionReplyMockData  } ) ; 
4454    } 
4555
4656    return  NextResponse . json ( {  data : questionAcceptanceReplyMockData  } ) ; 
4757  } 
4858
49-   if  ( body . intent  ===  ' TAROT_DECLINE' )  { 
59+   if  ( body . intent  ===  " TAROT_DECLINE" )  { 
5060    return  NextResponse . json ( {  data : normalReplyMockData  } ) ; 
5161  } 
5262
53-   if  ( body . intent  ===  ' RECOMMEND_QUESTION' )  { 
63+   if  ( body . intent  ===  " RECOMMEND_QUESTION" )  { 
5464    return  NextResponse . json ( {  data : questionReplyMockData  } ) ; 
5565  } 
5666
57-   return  NextResponse . json ( {  error : ' Invalid intent'   } ,  {  status : 400  } ) ; 
67+   return  NextResponse . json ( {  error : " Invalid intent"   } ,  {  status : 400  } ) ; 
5868} 
0 commit comments