Skip to content

Commit

Permalink
Merge pull request #42 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 12, 2024
2 parents b816746 + ddb0b4a commit 24ec5bc
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ public MessageResponse message(User user) throws IOException, ParseException {
String gu = user.getGu() + " ";
String combinedCity = city + gu;

MessageResponse result = null;
MessageResponse result = new MessageResponse("", "", new ArrayList<>(), new ArrayList<>(), "", "", "");
result.setTrans_MSG_CN("");
result.setTrnas_DSSTR("");
result.setTrans_AREA("");

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

Expand All @@ -122,15 +126,16 @@ public MessageResponse message(User user) throws IOException, ParseException {
}

// 데이터 담겨 있으면 중단하기
if(result != null) {
if(!(result.getMSG_CN().equals(""))) {

break;
}

}

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

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

Expand Down

0 comments on commit 24ec5bc

Please sign in to comment.