Skip to content

Commit

Permalink
Merge pull request GDSC-snowflowerthon#40 from GDSC-snowflowerthon/fe…
Browse files Browse the repository at this point in the history
…at/openApiParsing-3

[fix] 지역명, 재해구분명 번역 추가 GDSC-snowflowerthon#3
  • Loading branch information
ri-naa authored Jan 12, 2024
2 parents 578e067 + 31db6b1 commit b816746
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@
@Data
public class MessageResponse {
private String MSG_CN; //메세지 내용
private String trans_MSG_CN; //번역된 내용
private String CREAT_DT; //생성일
private List<String> RCV_AREA_ID; //수신지역 id
private List<String> RCV_AREA_NM; //수신지역명
private String EMRGNCY_STEP_ID; //긴급단계 id
private String DSSTR_SE_ID; //재해구분 id
private String DSSTR_SE_NM; //재해구분 명

private String trans_MSG_CN; //문자 번역
private String trans_AREA; //지역명 번역
private String trnas_DSSTR; //재해구분명 번역



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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,26 @@ public MessageResponse message(User user) throws IOException, ParseException {

if(result != null){
String MSG_CN = result.getMSG_CN();
String DSSTR = result.getDSSTR_SE_NM();

List<String> areaArr = result.getRCV_AREA_NM();
//문자 발송 지역 리스트 중 사용자
String AREA = "";
for (int i = 0; i < areaArr.size(); i++) {
if (combinedCity.equals(areaArr.get(i)) || city.equals(areaArr.get(i))) {
AREA = areaArr.get(i);
break;
}
}

String translatedMSG = naverTransService.getTransSentence(MSG_CN, user);
String translateDSSTR = naverTransService.getTransSentence(DSSTR, user);
String translateAREA = naverTransService.getTransSentence(AREA, user);

result.setTrans_MSG_CN(translatedMSG);
result.setTrnas_DSSTR(translateDSSTR);
result.setTrans_AREA(translateAREA);

}

return result;
Expand Down

0 comments on commit b816746

Please sign in to comment.