From 6f9f065a50fdf438eede8d95bbd95ee1cb490544 Mon Sep 17 00:00:00 2001 From: ri-naa Date: Sat, 13 Jan 2024 01:18:55 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20=EC=A7=80=EC=97=AD=EB=AA=85,=20?= =?UTF-8?q?=EC=9E=AC=ED=95=B4=EA=B5=AC=EB=B6=84=EB=AA=85=20=EB=B2=88?= =?UTF-8?q?=EC=97=AD=20=EC=B6=94=EA=B0=80=20#3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../message/dto/MessageResponse.java | 7 ++++++- .../message/service/MessageService.java | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/ALGo/ALGo_server/message/dto/MessageResponse.java b/src/main/java/com/ALGo/ALGo_server/message/dto/MessageResponse.java index 01cdd54..9636762 100644 --- a/src/main/java/com/ALGo/ALGo_server/message/dto/MessageResponse.java +++ b/src/main/java/com/ALGo/ALGo_server/message/dto/MessageResponse.java @@ -7,7 +7,6 @@ @Data public class MessageResponse { private String MSG_CN; //메세지 내용 - private String trans_MSG_CN; //번역된 내용 private String CREAT_DT; //생성일 private List RCV_AREA_ID; //수신지역 id private List RCV_AREA_NM; //수신지역명 @@ -15,6 +14,12 @@ public class MessageResponse { 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 RCV_AREA_ID, List 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; diff --git a/src/main/java/com/ALGo/ALGo_server/message/service/MessageService.java b/src/main/java/com/ALGo/ALGo_server/message/service/MessageService.java index a84d77c..800cf61 100644 --- a/src/main/java/com/ALGo/ALGo_server/message/service/MessageService.java +++ b/src/main/java/com/ALGo/ALGo_server/message/service/MessageService.java @@ -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 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;