Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/EFUB-SeeMe/SeeMe_Server into…
Browse files Browse the repository at this point in the history
… dev
  • Loading branch information
nitronium102 committed Aug 1, 2021
2 parents fd20348 + a7644dc commit ad0a45e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
14 changes: 7 additions & 7 deletions src/main/java/com/seeme/service/MicrodustService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -34,7 +34,7 @@ public MicrodustMainResDto getMain(List<String> 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()
Expand All @@ -43,7 +43,7 @@ public MicrodustMainResDto getMain(List<String> measuringStationList) {
e.printStackTrace();
ResDto resDto = ResDto.builder()
.resultCode(500)
.errorMessage(ErrorMessage.UNKNOWN_ERROR)
.errorMessage(ErrorMessageUtil.UNKNOWN_ERROR)
.document(null)
.build();

Expand Down Expand Up @@ -81,7 +81,7 @@ private ResDto getMainResDto(List<Microdust> microdustList) {

return ResDto.builder()
.resultCode(200)
.errorMessage(ErrorMessage.SUCCESS)
.errorMessage(ErrorMessageUtil.SUCCESS)
.document(MicrodustResDto.builder()
.pm10Flag(pm10Flag)
.pm25Flag(pm25Flag)
Expand All @@ -103,7 +103,7 @@ private ResDto getTotalResDto(List<Microdust> 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)
Expand All @@ -120,7 +120,7 @@ private ResDto getTotalResDto(List<Microdust> 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()))
Expand Down Expand Up @@ -156,7 +156,7 @@ private ResDto getMaskResDto(List<Microdust> microdustList) {

return ResDto.builder()
.resultCode(200)
.errorMessage(null)
.errorMessage("SUCCESS")
.document(MicrodustMaskResDto.builder()
.maskIcon(maskIcon)
.desc(desc)
Expand Down
22 changes: 11 additions & 11 deletions src/main/java/com/seeme/service/WeatherService.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -64,7 +64,7 @@ private ResDto getMainMinMaxResDto(List<Weather> weatherList) {

return ResDto.builder()
.resultCode(200)
.errorMessage(ErrorMessage.SUCCESS)
.errorMessage(ErrorMessageUtil.SUCCESS)
.document(WeatherMainMinMax.builder()
.min(weather.getMin())
.max(weather.getMax())
Expand All @@ -76,7 +76,7 @@ private ResDto getMainMinMaxResDto(List<Weather> weatherList) {
private ResDto getCurrentResDto(WeatherMain current) {
return ResDto.builder()
.resultCode(200)
.errorMessage(ErrorMessage.SUCCESS)
.errorMessage(ErrorMessageUtil.SUCCESS)
.document(current)
.build();
}
Expand All @@ -101,7 +101,7 @@ public ResDto getWeekResDto(List<Weather> weatherList) {
}
return ResDto.builder()
.resultCode(200)
.errorMessage(ErrorMessage.SUCCESS)
.errorMessage(ErrorMessageUtil.SUCCESS)
.document(week)
.build();
}
Expand All @@ -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();

Expand All @@ -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();

Expand All @@ -153,7 +153,7 @@ private ResDto getTempResDto(List<WeatherTime> weatherTimeList) {

return ResDto.builder()
.resultCode(200)
.errorMessage(ErrorMessage.SUCCESS)
.errorMessage(ErrorMessageUtil.SUCCESS)
.document(weatherTempResDtoList)
.build();
}
Expand All @@ -175,7 +175,7 @@ private ResDto getRainResDto(List<WeatherTime> weatherTimeList) {

return ResDto.builder()
.resultCode(200)
.errorMessage(ErrorMessage.SUCCESS)
.errorMessage(ErrorMessageUtil.SUCCESS)
.document(weatherRainResDtoList)
.build();
}
Expand Down Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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";
Expand Down

0 comments on commit ad0a45e

Please sign in to comment.