-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor/#254 미세먼지 리팩터링 #256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
limseohyeon
wants to merge
26
commits into
develop
Choose a base branch
from
refactor/#254-미세먼지-리팩터링
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
The head ref may contain hidden characters: "refactor/#254-\uBBF8\uC138\uBA3C\uC9C0-\uB9AC\uD329\uD130\uB9C1"
Open
Changes from 24 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
bd61714
feat: 미세먼지 기능 구현
limseohyeon 4e9c435
test: 미세먼지 service test
limseohyeon c4f58c4
test: 미세먼지 service Test 추가
limseohyeon 616da91
feat:Object 타입으로 변경
limseohyeon 157d16b
feat: 미세먼지 기능 구현
limseohyeon 8058da5
feat:Object 타입으로 변경
limseohyeon 8c38a5e
feat: 미세먼지 권한 수정
limseohyeon 02bba86
feat: 사용자 위치 기반 미세먼지 조회 기능 추가
limseohyeon bade1db
refactor: 불필요한 코드 제거
limseohyeon 939c3a0
refactor: 변수명 변경 및 불필요한 코드 제거
limseohyeon a8eddcf
feat: 측정소 null 반환시 예외 발생 추가
limseohyeon 4f5b6fb
test: 측성소 null 반환시 예외 발생 테스트 추가
limseohyeon 58c7182
refactor: key+지역코드 함수 분리
limseohyeon 143efd4
refactor: key값 변환 위임 숨기기
limseohyeon 79d7c74
refactor: 미세먼지 캐싱 Class 분리
limseohyeon d70d7e9
refactor: 위치별 미세먼지 구분로직 분리를 위한 interface 추가
limseohyeon 044f3af
refactor: 서울 외 지역 미세먼지 Class 분리
limseohyeon 7cdb4b8
refactor: 서울 미세먼지 Class 분리
limseohyeon c1cf980
refactor: 분리한 Class를 호출 Service에 적용
limseohyeon d931279
refactor : 스케줄러 분리한 Class 적용
limseohyeon f49b1b1
refacter: 분리한 Class test적용
limseohyeon fc780b2
refactor: 불필요한 import 삭제
limseohyeon 3f91e91
refactor: 함수명 변경
limseohyeon ca34278
refactor: 불필요한 코드 제거
limseohyeon 729edf9
refactor: 불필요한 interface 제거
limseohyeon e5b3095
refactor: 명확한 분리를 위한 구현체 이름 변경
limseohyeon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
src/main/java/org/programmers/signalbuddyfinal/domain/air_quality/dto/AirQuality.java
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
src/main/java/org/programmers/signalbuddyfinal/domain/air_quality/dto/AirQualityItems.java
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
src/main/java/org/programmers/signalbuddyfinal/domain/air_quality/dto/Observatory.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| package org.programmers.signalbuddyfinal.domain.air_quality.dto; | ||
|
|
||
| import lombok.Data; | ||
| import java.util.List; | ||
|
|
||
|
|
||
| public class Observatory { | ||
|
|
||
| @Data | ||
| public static class Response { | ||
| private Body body; | ||
| private Header header; | ||
| } | ||
|
|
||
| @Data | ||
| public static class Body { | ||
| private int totalCount; | ||
| private List<Item> items; | ||
| private int pageNo; | ||
| private int numOfRows; | ||
| } | ||
|
|
||
| @Data | ||
| public static class Item { | ||
| private String stationCode; | ||
| private double tm; | ||
| private String addr; | ||
| private String stationName; | ||
| } | ||
|
|
||
| @Data | ||
| public static class Header { | ||
| private String resultMsg; | ||
| private String resultCode; | ||
| } | ||
| } |
15 changes: 15 additions & 0 deletions
15
...ain/java/org/programmers/signalbuddyfinal/domain/air_quality/dto/ObservatoryResponse.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| package org.programmers.signalbuddyfinal.domain.air_quality.dto; | ||
|
|
||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
|
|
||
| @Getter | ||
| @Builder | ||
| public class ObservatoryResponse { | ||
|
|
||
| private String addr; | ||
|
|
||
| private String stationName; | ||
|
|
||
| private String stationCode; | ||
| } |
60 changes: 60 additions & 0 deletions
60
src/main/java/org/programmers/signalbuddyfinal/domain/air_quality/dto/RegionAirQuality.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| package org.programmers.signalbuddyfinal.domain.air_quality.dto; | ||
|
|
||
| import lombok.Builder; | ||
| import java.util.List; | ||
| import lombok.Getter; | ||
|
|
||
| @Builder | ||
| @Getter | ||
| public class RegionAirQuality { | ||
| private Response response; | ||
|
|
||
| @Builder | ||
| @Getter | ||
| public static class Response { | ||
| private Body body; | ||
| private Header header; | ||
| } | ||
|
|
||
| @Builder | ||
| @Getter | ||
| public static class Body { | ||
| private int totalCount; | ||
| private List<Item> items; | ||
| private int pageNo; | ||
| private int numOfRows; | ||
| } | ||
|
|
||
| @Builder | ||
| @Getter | ||
| public static class Item { | ||
| private String so2Grade; | ||
| private String coFlag; | ||
| private String khaiValue; | ||
| private String so2Value; | ||
| private String coValue; | ||
| private String pm25Flag; | ||
| private String pm10Flag; | ||
| private String pm10Value; | ||
| private String o3Grade; | ||
| private String khaiGrade; | ||
| private String pm25Value; | ||
| private String no2Flag; | ||
| private String no2Grade; | ||
| private String o3Flag; | ||
| private String pm25Grade; | ||
| private String so2Flag; | ||
| private String dataTime; | ||
| private String coGrade; | ||
| private String no2Value; | ||
| private String pm10Grade; | ||
| private String o3Value; | ||
| } | ||
|
|
||
| @Builder | ||
| @Getter | ||
| public static class Header { | ||
| private String resultMsg; | ||
| private String resultCode; | ||
| } | ||
| } |
19 changes: 0 additions & 19 deletions
19
src/main/java/org/programmers/signalbuddyfinal/domain/air_quality/dto/Result.java
This file was deleted.
Oops, something went wrong.
68 changes: 68 additions & 0 deletions
68
src/main/java/org/programmers/signalbuddyfinal/domain/air_quality/dto/SeoulAirQuality.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| package org.programmers.signalbuddyfinal.domain.air_quality.dto; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; | ||
| import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; | ||
| import java.util.List; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
|
|
||
| @Getter | ||
| @Builder | ||
| public class SeoulAirQuality { | ||
|
|
||
| @JsonProperty("list_total_count") | ||
| private int totalCount; | ||
|
|
||
| @JsonProperty("RESULT") | ||
| private Result result; | ||
|
|
||
| private List<Item> row; | ||
|
|
||
| @Getter | ||
| @Builder | ||
| @JacksonXmlRootElement(localName = "RESULT") | ||
| public static class Result { | ||
|
|
||
| @JsonProperty("CODE") | ||
| @JacksonXmlProperty(localName = "CODE") | ||
| private String code; | ||
|
|
||
| @JsonProperty("MESSAGE") | ||
| @JacksonXmlProperty(localName = "MESSAGE") | ||
| private String message; | ||
| } | ||
|
|
||
| @Getter | ||
| @Builder | ||
| public static class Item{ | ||
|
|
||
| @JsonProperty("GRADE") | ||
| private String grade; | ||
|
|
||
| @JsonProperty("IDEX_MVL") | ||
| private String mvl; | ||
|
|
||
| @JsonProperty("POLLUTANT") | ||
| private String pollutant; | ||
|
|
||
| @JsonProperty("NITROGEN") | ||
| private String nitrogen; | ||
|
|
||
| @JsonProperty("OZONE") | ||
| private String ozone; | ||
|
|
||
| @JsonProperty("CARBON") | ||
| private String carbon; | ||
|
|
||
| @JsonProperty("SULFUROUS") | ||
| private String sulfurous; | ||
|
|
||
| @JsonProperty("PM10") | ||
| private String pm10; | ||
|
|
||
| @JsonProperty("PM25") | ||
| private String pm25; | ||
|
|
||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...ain/java/org/programmers/signalbuddyfinal/domain/air_quality/service/AirQualityCache.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package org.programmers.signalbuddyfinal.domain.air_quality.service; | ||
|
|
||
| import org.programmers.signalbuddyfinal.domain.air_quality.dto.AirQualityResponse; | ||
| import org.programmers.signalbuddyfinal.domain.air_quality.dto.CachedAirQuality; | ||
|
|
||
| public interface AirQualityCache { | ||
|
|
||
| CachedAirQuality get(String regionCode); | ||
| void save(String key, AirQualityResponse response, boolean fresh); | ||
| AirQualityResponse failBackOrThrow(String key); | ||
|
|
||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.