-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Feat: customException 구현 * Feat: responseDto 구현 * Feat: 내 근처 킥보드 주차장 찾기 API 구현 * Fix: BoardingRecord 도메인 수정 * Feat: Spring Security, JWT Cookie, 소셜 로그인 기능 구현 * Feat: Spring Security, JWT Cookie, 소셜 로그인 기능 구현 * Fix: 코드 에러 수정 * Refactor: 아직 사용하지 않는 코드 삭제 * Feat: oauth2 의존성 추가 * Chore: Credentials 추가 * ✨ [Feature] - 서버 날짜 설정 및 유저 닉네임 설정 (#15) * Feat: 스프링 서버 시간 한국으로 설정 * Feat: 사용자 닉네임 지정 로직 추가 * Fix: 초기 포인트 설정 * Fix: nickname 에러 수정 (#18) * Fix: BoardingRecord 도메인 수정 * Feat: 디펜던시 추가 * Feat: ErrorCode 추가 * Feat: Image API 구현 * Feat: WebClientConfig 구현 * Feat: S3ClientConfig 구현 * Feat: BoardingRecord API 구현 * Feat: 주차장 예측 결과 관련 기능 추가 * Feat: 탑승 기록 저장 API 구현 * Fix: 디렉토리 경로 수정 * Feat: 코드 리팩터링 진행 * Chore: Credentials 수정 (#29) * !HOTFIX: 서브 모듈 컨플릭트 해결 * ✨ [Feature] - Reissue 토큰 기능 추가 (#31) * Chore: Credentials 수정 * Feat: Reissue 토큰 기능 구현 * Chore: Credentials 추가 * Fix: JsonProperty 추가 * Fix: ResponseDto 필드변수 이름 수정 * Fix: ResponseDto 필드변수 이름 수정 (#35) * Feat: District 도메인 생성 * Feat: District 도메인 컬럼 추가 * Feat: District API 구현 * Feat: District API 관련 DTO 구현 * Feat: District API 관련 DTO 구현 * Feat: RestTemplateService 구현 * Fix: ResponseDto 필드변수 이름 수정 (#38) * Feat: 실시간 날씨 확인 DTO 구현 * Feat: 실시간 날씨 확인 API 구현 * Fix: 변수명 수정 --------- Co-authored-by: JeongHeumChoi <[email protected]> Co-authored-by: JeongHeumChoi <[email protected]>
- Loading branch information
1 parent
53c6146
commit f0bb8b6
Showing
20 changed files
with
483 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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 ice.spot.controller; | ||
|
||
import ice.spot.annotation.UserId; | ||
import ice.spot.domain.District; | ||
import ice.spot.dto.district.response.TemperatureResponse; | ||
import ice.spot.dto.global.ResponseDto; | ||
import ice.spot.service.DistrictService; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@Slf4j | ||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api/district") | ||
public class DistrictController { | ||
private final DistrictService districtService; | ||
|
||
@GetMapping("/location") | ||
public ResponseDto<?> getLocation(@RequestParam Double lat, @RequestParam Double lon) { | ||
return ResponseDto.ok(districtService.getLocation(lat, lon)); | ||
} | ||
|
||
@GetMapping("/temperature") | ||
public ResponseDto<?> getTemperatureAndHumidity(@RequestParam Double lat, @RequestParam Double lon) { | ||
return ResponseDto.ok(districtService.getTemperatureAndHumidity(lat, lon)); | ||
} | ||
|
||
@GetMapping("/point") | ||
public ResponseDto<?> getPointAndDust(@UserId Long userId, @RequestParam Double lat, @RequestParam Double lon) { | ||
return ResponseDto.ok(districtService.getPointAndDust(userId, lat, lon)); | ||
} | ||
} |
This file contains 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,37 @@ | ||
package ice.spot.domain; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Table(name = "district") | ||
public class District { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@Column(name = "territory") | ||
private String territory; | ||
|
||
@Column(name = "address") | ||
private String address; | ||
|
||
@Column(name = "detail_address") | ||
private String detailAddress; | ||
|
||
@Column(name = "grid_x") | ||
private Integer gridX; | ||
|
||
@Column(name = "grid_y") | ||
private Integer gridY; | ||
|
||
@Column(name = "lat") | ||
private Double lat; | ||
|
||
@Column(name = "lon") | ||
private Double lon; | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/ice/spot/dto/district/response/LocationResponse.java
This file contains 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,16 @@ | ||
package ice.spot.dto.district.response; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public record LocationResponse( | ||
@JsonProperty("location") | ||
String location | ||
) { | ||
public LocationResponse(String location) { | ||
this.location = location; | ||
} | ||
|
||
public static LocationResponse of(String location) { | ||
return new LocationResponse(location); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/ice/spot/dto/district/response/PointResponse.java
This file contains 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,17 @@ | ||
package ice.spot.dto.district.response; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record PointResponse( | ||
@JsonProperty("point") | ||
Long point, | ||
|
||
@JsonProperty("pm10") | ||
Double pm10, | ||
|
||
@JsonProperty("pm25") | ||
Double pm25 | ||
) { | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/ice/spot/dto/district/response/TemperatureResponse.java
This file contains 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 ice.spot.dto.district.response; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Builder; | ||
|
||
@Builder | ||
public record TemperatureResponse ( | ||
@JsonProperty("temperature") | ||
Double temperature, | ||
|
||
@JsonProperty("humidity") | ||
Double humidity | ||
) { | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/ice/spot/dto/district/response/dust/DustResponse.java
This file contains 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,11 @@ | ||
package ice.spot.dto.district.response.dust; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record DustResponse( | ||
Double pm10, | ||
|
||
Double pm25 | ||
) { | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/ice/spot/dto/district/response/dust/DustResultResponse.java
This file contains 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,9 @@ | ||
package ice.spot.dto.district.response.dust; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public record DustResultResponse( | ||
@JsonProperty("RealtimeCityAir") | ||
RealtimeCityAirResponse realtimeCityAirResponse | ||
) { | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/ice/spot/dto/district/response/dust/RealtimeCityAirResponse.java
This file contains 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,17 @@ | ||
package ice.spot.dto.district.response.dust; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.util.List; | ||
|
||
public record RealtimeCityAirResponse( | ||
@JsonProperty("list_total_count") | ||
Integer count, | ||
|
||
@JsonProperty("RESULT") | ||
ResultResponse resultResponse, | ||
|
||
@JsonProperty("row") | ||
List<RowResponse> rowResponses | ||
) { | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/ice/spot/dto/district/response/dust/ResultResponse.java
This file contains 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 ice.spot.dto.district.response.dust; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public record ResultResponse( | ||
@JsonProperty("CODE") | ||
String code, | ||
|
||
@JsonProperty("MESSAGE") | ||
String message | ||
) { | ||
} |
42 changes: 42 additions & 0 deletions
42
src/main/java/ice/spot/dto/district/response/dust/RowResponse.java
This file contains 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,42 @@ | ||
package ice.spot.dto.district.response.dust; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public record RowResponse( | ||
@JsonProperty("MSRDT") | ||
String MSRDT, | ||
|
||
@JsonProperty("MSRRGN_NM") | ||
String MSRRGN_NM, | ||
|
||
@JsonProperty("MSRSTE_NM") | ||
String MSRSTE_NM, | ||
|
||
@JsonProperty("PM10") | ||
Double PM10, | ||
|
||
@JsonProperty("PM25") | ||
Double PM25, | ||
|
||
@JsonProperty("O3") | ||
Double O3, | ||
|
||
@JsonProperty("NO2") | ||
Double NO2, | ||
|
||
@JsonProperty("CO") | ||
Double CO, | ||
|
||
@JsonProperty("SO2") | ||
Double SO2, | ||
|
||
@JsonProperty("IDEX_NM") | ||
String IDEX_NM, | ||
|
||
@JsonProperty("IDEX_MVL") | ||
Double IDEX_MVL, | ||
|
||
@JsonProperty("ARPLT_MAIN") | ||
String ARPLT_MAIN | ||
) { | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/ice/spot/dto/district/response/weather/RealtimeWeatherResponse.java
This file contains 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,13 @@ | ||
package ice.spot.dto.district.response.weather; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public record RealtimeWeatherResponse( | ||
@JsonProperty("header") | ||
WeatherHeader weatherHeader, | ||
|
||
@JsonProperty("body") | ||
WeatherBody weatherBody | ||
) { | ||
} | ||
|
21 changes: 21 additions & 0 deletions
21
src/main/java/ice/spot/dto/district/response/weather/WeatherBody.java
This file contains 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,21 @@ | ||
package ice.spot.dto.district.response.weather; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public record WeatherBody( | ||
@JsonProperty("dataType") | ||
String dataType, | ||
|
||
@JsonProperty("items") | ||
WeatherItemListResponse weatherItemListResponse, | ||
|
||
@JsonProperty("pageNo") | ||
Integer pageNo, | ||
|
||
@JsonProperty("numOfRows") | ||
Integer numOfRows, | ||
|
||
@JsonProperty("totalCount") | ||
Integer totalCount | ||
) { | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/ice/spot/dto/district/response/weather/WeatherHeader.java
This file contains 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 ice.spot.dto.district.response.weather; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public record WeatherHeader( | ||
@JsonProperty("resultCode") | ||
String resultCode, | ||
|
||
@JsonProperty("resultMsg") | ||
String resultMsg | ||
) { | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/ice/spot/dto/district/response/weather/WeatherItemListResponse.java
This file contains 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,11 @@ | ||
package ice.spot.dto.district.response.weather; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.util.List; | ||
|
||
public record WeatherItemListResponse( | ||
@JsonProperty("item") | ||
List<WeatherItemResponse> weatherItemResponses | ||
) { | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/ice/spot/dto/district/response/weather/WeatherItemResponse.java
This file contains 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,24 @@ | ||
package ice.spot.dto.district.response.weather; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public record WeatherItemResponse( | ||
@JsonProperty("baseDate") | ||
String baseDate, | ||
|
||
@JsonProperty("baseTime") | ||
String baseTime, | ||
|
||
@JsonProperty("category") | ||
String category, | ||
|
||
@JsonProperty("nx") | ||
Integer nx, | ||
|
||
@JsonProperty("ny") | ||
Integer ny, | ||
|
||
@JsonProperty("obsrValue") | ||
String obsrValue | ||
) { | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/ice/spot/dto/district/response/weather/WeatherResultResponse.java
This file contains 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,9 @@ | ||
package ice.spot.dto.district.response.weather; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public record WeatherResultResponse( | ||
@JsonProperty("response") | ||
RealtimeWeatherResponse realtimeWeatherResponse | ||
) { | ||
} |
This file contains 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,7 @@ | ||
package ice.spot.repository; | ||
|
||
import ice.spot.domain.District; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface DistrictRepository extends JpaRepository<District, Long> { | ||
} |
Oops, something went wrong.