-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1623 from innovationacademy-kr/common/dev/feat_co…
…in/admin/hyowchoi#1604 Common/dev/feat coin/admin/hyowchoi#1604
- Loading branch information
Showing
11 changed files
with
298 additions
and
6 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
...main/java/org/ftclub/cabinet/admin/statistics/controller/AdminStatisticsControllerV5.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,49 @@ | ||
package org.ftclub.cabinet.admin.statistics.controller; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.ftclub.cabinet.admin.statistics.service.AdminStatisticsFacadeService; | ||
import org.ftclub.cabinet.auth.domain.AuthGuard; | ||
import org.ftclub.cabinet.auth.domain.AuthLevel; | ||
import org.ftclub.cabinet.dto.CoinCollectStatisticsDto; | ||
import org.ftclub.cabinet.dto.TotalCoinAmountDto; | ||
import org.ftclub.cabinet.log.Logging; | ||
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; | ||
|
||
@RestController | ||
@RequestMapping("/v5/admin/statistics") | ||
@RequiredArgsConstructor | ||
@Logging | ||
public class AdminStatisticsControllerV5 { | ||
|
||
private final AdminStatisticsFacadeService adminStatisticsFacadeService; | ||
|
||
/** | ||
* 특정 연도, 월의 동전 줍기 횟수를 횟수 별로 통계를 내서 반환 | ||
* | ||
* @param year | ||
* @param month 조회를 원하는 기간 | ||
* @return | ||
*/ | ||
@GetMapping("/coins/collect") | ||
@AuthGuard(level = AuthLevel.ADMIN_ONLY) | ||
public CoinCollectStatisticsDto getCoinCollectCountByMonth( | ||
@RequestParam("year") Integer year, | ||
@RequestParam("month") Integer month) { | ||
return adminStatisticsFacadeService.getCoinCollectCountByMonth(year, month); | ||
} | ||
|
||
/** | ||
* 전체 기간동안 동전의 발행량 및 사용량 반환 | ||
* | ||
* @return | ||
*/ | ||
@GetMapping("/coins") | ||
@AuthGuard(level = AuthLevel.ADMIN_ONLY) | ||
public TotalCoinAmountDto getTotalCoinAmount() { | ||
return adminStatisticsFacadeService.getTotalCoinAmount(); | ||
} | ||
|
||
} |
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
15 changes: 15 additions & 0 deletions
15
backend/src/main/java/org/ftclub/cabinet/dto/CoinCollectStatisticsDto.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 org.ftclub.cabinet.dto; | ||
|
||
import java.util.List; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
@Getter | ||
@ToString | ||
@AllArgsConstructor | ||
public class CoinCollectStatisticsDto { | ||
|
||
private List<CoinCollectedCountDto> coinCollectStatistics; | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
backend/src/main/java/org/ftclub/cabinet/dto/CoinCollectedCountDto.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,14 @@ | ||
package org.ftclub.cabinet.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
@Getter | ||
@ToString | ||
@AllArgsConstructor | ||
public class CoinCollectedCountDto { | ||
|
||
private Integer coinCount; | ||
private Integer userCount; | ||
} |
12 changes: 12 additions & 0 deletions
12
backend/src/main/java/org/ftclub/cabinet/dto/TotalCoinAmountDto.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 org.ftclub.cabinet.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class TotalCoinAmountDto { | ||
|
||
private Long used; | ||
private Long unused; | ||
} |
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
Oops, something went wrong.