Skip to content

Commit

Permalink
Merge pull request #30 from GDSC-snowflowerthon/feat/openApiParsing-3
Browse files Browse the repository at this point in the history
[fix] 재난문자 번역 수정 #3
  • Loading branch information
ri-naa authored Jan 11, 2024
2 parents 82e20cb + c014dcb commit 5c356a2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public class MessageResponse {
private String DSSTR_SE_ID; //재해구분 id
private String DSSTR_SE_NM; //재해구분 명

public MessageResponse(String MSG_CN, String trans_MSG_CN, String CREAT_DT, List<String> RCV_AREA_ID, List<String> RCV_AREA_NM, String EMRGNCY_STEP_ID, String DSSTR_SE_ID, String DSSTR_SE_NM){
public MessageResponse(String MSG_CN, String CREAT_DT, List<String> RCV_AREA_ID, List<String> RCV_AREA_NM, String EMRGNCY_STEP_ID, String DSSTR_SE_ID, String DSSTR_SE_NM){
this.MSG_CN = MSG_CN;
this.trans_MSG_CN = trans_MSG_CN;
//this.trans_MSG_CN = trans_MSG_CN;
this.CREAT_DT = CREAT_DT;
this.RCV_AREA_ID = RCV_AREA_ID;
this.RCV_AREA_NM = RCV_AREA_NM;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ public MessageResponse message(User user) throws IOException, ParseException {
String a = areaNmArr.get(j);
}

String translatedMSG = naverTransService.getTransSentence(MSG_CN, user);
MessageResponse response = new MessageResponse(MSG_CN, translatedMSG, CREAT_DT, areaIdArr, areaNmArr, EMRGNCY_STEP_ID, DSSTR_SE_ID, DSSTR_SE_NM);
//String translatedMSG = naverTransService.getTransSentence(MSG_CN, user);
MessageResponse response = new MessageResponse(MSG_CN, CREAT_DT, areaIdArr, areaNmArr, EMRGNCY_STEP_ID, DSSTR_SE_ID, DSSTR_SE_NM);

msgResArr.add(response);
}
Expand All @@ -107,7 +107,6 @@ public MessageResponse message(User user) throws IOException, ParseException {
String combinedCity = city + gu;

MessageResponse result = null;

// 지역 찾기
for (int i=0; i<msgResArr.size(); i++) {

Expand All @@ -128,6 +127,15 @@ public MessageResponse message(User user) throws IOException, ParseException {
}

}

//String translatedMSG = naverTransService.getTransSentence(MSG_CN, user);

if(result != null){
String MSG_CN = result.getMSG_CN();
String translatedMSG = naverTransService.getTransSentence(MSG_CN, user);
result.setTrans_MSG_CN(translatedMSG);
}

return result;

}
Expand Down

0 comments on commit 5c356a2

Please sign in to comment.