-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 충전기 상태 및 혼잡도를 저장하는 기능을 구현한다 (#113)
* feat: 충전기 상태 업데이트 기능 [#21] * feat: 주기적으로 충전기 정보 업데이트 기능 구현 [#21] * feat: 혼잡도 정보 업데이트 기능 구현 [#21] * refactor: 사용하지 않는 메서드 제거 및 매직넘버 처리 * refactor: 코드리뷰를 반영한다 [#21] * feat: 혼잡도를 조회하는 컨트롤러 작성 [#21] [#21)] * feat: adoc 작성 [#21] * feat: 처음 저장시 status 도 함께 저장하도록 변경 [#21] * fix: charger 조회시, status null 인 경우 false를 반환하도록 한다 [#21] --------- Co-authored-by: be-student <[email protected]>
- Loading branch information
1 parent
ddbdb4f
commit 62c3185
Showing
32 changed files
with
502 additions
and
116 deletions.
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.