-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: 충전기 상태 및 혼잡도를 저장하는 기능을 구현한다 #113
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f01d7c9
feat: 충전기 상태 업데이트 기능
be-student 2916a3c
feat: 주기적으로 충전기 정보 업데이트 기능 구현
be-student 619e61c
feat: 혼잡도 정보 업데이트 기능 구현
be-student 002690b
refactor: 사용하지 않는 메서드 제거 및 매직넘버 처리
kiarakim 7fd0167
refactor: 코드리뷰를 반영한다
be-student 5d4c841
feat: 혼잡도를 조회하는 컨트롤러 작성
be-student a44f9e0
feat: adoc 작성
be-student 16354c5
feat: 처음 저장시 status 도 함께 저장하도록 변경
be-student d2e381e
fix: charger 조회시, status null 인 경우 false를 반환하도록 한다
be-student 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 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
9 changes: 9 additions & 0 deletions
9
backend/src/main/java/com/carffeine/carffeine/config/SchedulingConfig.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 com.carffeine.carffeine.config; | ||
|
||
import org.springframework.scheduling.annotation.EnableScheduling; | ||
import org.springframework.stereotype.Component; | ||
|
||
@EnableScheduling | ||
@Component | ||
public class SchedulingConfig { | ||
} |
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
23 changes: 23 additions & 0 deletions
23
...end/src/main/java/com/carffeine/carffeine/controller/congestion/CongestionController.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,23 @@ | ||
package com.carffeine.carffeine.controller.congestion; | ||
|
||
import com.carffeine.carffeine.controller.chargerStation.dto.StatisticsResponse; | ||
import com.carffeine.carffeine.service.chargerstation.CongestionService; | ||
import com.carffeine.carffeine.service.chargerstation.dto.StatisticsRequest; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RequiredArgsConstructor | ||
@RestController | ||
public class CongestionController { | ||
|
||
private final CongestionService congestionService; | ||
|
||
@GetMapping("/api/stations/{stationId}/statistics") | ||
public ResponseEntity<StatisticsResponse> showCongestionStatistics(@PathVariable String stationId) { | ||
StatisticsResponse statisticsResponse = congestionService.calculateCongestion(new StatisticsRequest(stationId)); | ||
return ResponseEntity.ok(statisticsResponse); | ||
} | ||
} |
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
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
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
10 changes: 10 additions & 0 deletions
10
...in/java/com/carffeine/carffeine/domain/chargestation/charger/ChargerStatusRepository.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,10 @@ | ||
package com.carffeine.carffeine.domain.chargestation.charger; | ||
|
||
import org.springframework.data.repository.Repository; | ||
|
||
import java.util.List; | ||
|
||
public interface ChargerStatusRepository extends Repository<ChargerStatus, ChargerId> { | ||
|
||
List<ChargerStatus> findAll(); | ||
} |
6 changes: 0 additions & 6 deletions
6
...nd/src/main/java/com/carffeine/carffeine/domain/chargestation/congestion/IdGenerator.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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id값이 유니크한 값을 가지면서 데이터처럼 사용되네요👍 이 방법은 추후에 문제점은 없을까요?