diff --git a/src/main/java/com/seeme/service/MicrodustService.java b/src/main/java/com/seeme/service/MicrodustService.java index 7d5169c..c3b3c65 100644 --- a/src/main/java/com/seeme/service/MicrodustService.java +++ b/src/main/java/com/seeme/service/MicrodustService.java @@ -3,7 +3,7 @@ import com.seeme.domain.ResDto; import com.seeme.domain.microdust.*; import com.seeme.service.api.MicrodustOpenApi; -import com.seeme.util.ErrorMessage; +import com.seeme.util.ErrorMessageUtil; import com.seeme.util.MicrodustUtil; import lombok.AllArgsConstructor; import org.json.simple.parser.ParseException; @@ -34,7 +34,7 @@ public MicrodustMainResDto getMain(List measuringStationList) { e.printStackTrace(); ResDto resDto = ResDto.builder() .resultCode(500) - .errorMessage(ErrorMessage.JSON_PARSING_ERROR) + .errorMessage(ErrorMessageUtil.JSON_PARSING_ERROR) .document(null) .build(); return MicrodustMainResDto.builder() @@ -43,7 +43,7 @@ public MicrodustMainResDto getMain(List measuringStationList) { e.printStackTrace(); ResDto resDto = ResDto.builder() .resultCode(500) - .errorMessage(ErrorMessage.UNKNOWN_ERROR) + .errorMessage(ErrorMessageUtil.UNKNOWN_ERROR) .document(null) .build(); @@ -81,7 +81,7 @@ private ResDto getMainResDto(List microdustList) { return ResDto.builder() .resultCode(200) - .errorMessage(ErrorMessage.SUCCESS) + .errorMessage(ErrorMessageUtil.SUCCESS) .document(MicrodustResDto.builder() .pm10Flag(pm10Flag) .pm25Flag(pm25Flag) @@ -103,7 +103,7 @@ private ResDto getTotalResDto(List microdustList) { return ResDto.builder() .resultCode(200) - .errorMessage(ErrorMessage.SUCCESS) + .errorMessage(ErrorMessageUtil.SUCCESS) .document(MicrodustTotalResDto.builder() .pm10(Double.parseDouble(microdust.getPm10Value())).pm10Flag(true) .pm25(Double.parseDouble(microdust.getPm25Value())).pm25Flag(true) @@ -120,7 +120,7 @@ private ResDto getTotalResDto(List microdustList) { Microdust microdust = microdustList.get(0); return ResDto.builder() .resultCode(200) - .errorMessage(ErrorMessage.SUCCESS) + .errorMessage(ErrorMessageUtil.SUCCESS) .document(MicrodustTotalResDto.builder() .pm10(MicrodustUtil.getDouble(microdust.getPm10Value())) .pm10Flag(MicrodustUtil.getBool(microdust.getPm10Value())) @@ -156,7 +156,7 @@ private ResDto getMaskResDto(List microdustList) { return ResDto.builder() .resultCode(200) - .errorMessage(null) + .errorMessage("SUCCESS") .document(MicrodustMaskResDto.builder() .maskIcon(maskIcon) .desc(desc) diff --git a/src/main/java/com/seeme/service/WeatherService.java b/src/main/java/com/seeme/service/WeatherService.java index 5168284..6a6d342 100644 --- a/src/main/java/com/seeme/service/WeatherService.java +++ b/src/main/java/com/seeme/service/WeatherService.java @@ -3,7 +3,7 @@ import com.seeme.domain.ResDto; import com.seeme.domain.weather.*; import com.seeme.service.api.WeatherOpenApi; -import com.seeme.util.ErrorMessage; +import com.seeme.util.ErrorMessageUtil; import com.seeme.util.WeatherUtil; import lombok.AllArgsConstructor; import org.springframework.stereotype.Service; @@ -42,7 +42,7 @@ public WeatherMainResDto getMain(Double lat, Double lon) { e.printStackTrace(); ResDto resDto = ResDto.builder() .resultCode(500) - .errorMessage(ErrorMessage.JSON_PARSING_ERROR) + .errorMessage(ErrorMessageUtil.JSON_PARSING_ERROR) .document(null) .build(); return WeatherMainResDto.builder() @@ -51,7 +51,7 @@ public WeatherMainResDto getMain(Double lat, Double lon) { e.printStackTrace(); ResDto resDto = ResDto.builder() .resultCode(500) - .errorMessage(ErrorMessage.UNKNOWN_ERROR) + .errorMessage(ErrorMessageUtil.UNKNOWN_ERROR) .document(null) .build(); return WeatherMainResDto.builder() @@ -64,7 +64,7 @@ private ResDto getMainMinMaxResDto(List weatherList) { return ResDto.builder() .resultCode(200) - .errorMessage(ErrorMessage.SUCCESS) + .errorMessage(ErrorMessageUtil.SUCCESS) .document(WeatherMainMinMax.builder() .min(weather.getMin()) .max(weather.getMax()) @@ -76,7 +76,7 @@ private ResDto getMainMinMaxResDto(List weatherList) { private ResDto getCurrentResDto(WeatherMain current) { return ResDto.builder() .resultCode(200) - .errorMessage(ErrorMessage.SUCCESS) + .errorMessage(ErrorMessageUtil.SUCCESS) .document(current) .build(); } @@ -101,7 +101,7 @@ public ResDto getWeekResDto(List weatherList) { } return ResDto.builder() .resultCode(200) - .errorMessage(ErrorMessage.SUCCESS) + .errorMessage(ErrorMessageUtil.SUCCESS) .document(week) .build(); } @@ -118,7 +118,7 @@ public WeatherTimeResDto getTime(Double lat, Double lon) { e.printStackTrace(); ResDto resDto = ResDto.builder() .resultCode(500) - .errorMessage(ErrorMessage.JSON_PARSING_ERROR) + .errorMessage(ErrorMessageUtil.JSON_PARSING_ERROR) .document(null) .build(); @@ -128,7 +128,7 @@ public WeatherTimeResDto getTime(Double lat, Double lon) { e.printStackTrace(); ResDto resDto = ResDto.builder() .resultCode(500) - .errorMessage(ErrorMessage.UNKNOWN_ERROR) + .errorMessage(ErrorMessageUtil.UNKNOWN_ERROR) .document(null) .build(); @@ -153,7 +153,7 @@ private ResDto getTempResDto(List weatherTimeList) { return ResDto.builder() .resultCode(200) - .errorMessage(ErrorMessage.SUCCESS) + .errorMessage(ErrorMessageUtil.SUCCESS) .document(weatherTempResDtoList) .build(); } @@ -175,7 +175,7 @@ private ResDto getRainResDto(List weatherTimeList) { return ResDto.builder() .resultCode(200) - .errorMessage(ErrorMessage.SUCCESS) + .errorMessage(ErrorMessageUtil.SUCCESS) .document(weatherRainResDtoList) .build(); } @@ -210,7 +210,7 @@ private ResDto getOotdResDto(ResDto currentResDto, ResDto mixmaxResDto) throws I return ResDto.builder() .resultCode(200) - .errorMessage(ErrorMessage.SUCCESS) + .errorMessage(ErrorMessageUtil.SUCCESS) .document(ootd) .build(); } diff --git a/src/main/java/com/seeme/util/ErrorMessage.java b/src/main/java/com/seeme/util/ErrorMessageUtil.java similarity index 89% rename from src/main/java/com/seeme/util/ErrorMessage.java rename to src/main/java/com/seeme/util/ErrorMessageUtil.java index 5503ac1..604dc4a 100644 --- a/src/main/java/com/seeme/util/ErrorMessage.java +++ b/src/main/java/com/seeme/util/ErrorMessageUtil.java @@ -1,6 +1,6 @@ package com.seeme.util; -public class ErrorMessage { +public class ErrorMessageUtil { public static final String API_PROVISION_ERROR = "API_PROVISION_ERROR"; public static final String JSON_PARSING_ERROR = "JSON_PARSING_ERROR";