|
1 | 1 | package kr.co.knuserver.presentation.booth; |
2 | 2 |
|
3 | | -import jakarta.validation.Valid; |
4 | 3 | import java.util.List; |
5 | | -import kr.co.knuserver.application.booth.BoothCommandService; |
6 | 4 | import kr.co.knuserver.application.booth.BoothQueryService; |
7 | 5 | import kr.co.knuserver.global.dto.CursorPaginationResponse; |
8 | 6 | import kr.co.knuserver.global.exception.ApiResponse; |
|
12 | 10 | import kr.co.knuserver.presentation.booth.dto.BoothListResponseDto; |
13 | 11 | import kr.co.knuserver.presentation.booth.dto.BoothRankingResponseDto; |
14 | 12 | import kr.co.knuserver.presentation.booth.dto.BoothTop3ResponseDto; |
15 | | -import kr.co.knuserver.presentation.booth.dto.BoothUpdateRequestDto; |
16 | 13 | import lombok.RequiredArgsConstructor; |
17 | 14 | import org.springframework.http.HttpStatus; |
18 | | -import org.springframework.http.MediaType; |
19 | 15 | import org.springframework.http.ResponseEntity; |
20 | 16 | import org.springframework.web.bind.annotation.GetMapping; |
21 | | -import org.springframework.web.bind.annotation.PatchMapping; |
22 | 17 | import org.springframework.web.bind.annotation.PathVariable; |
23 | | -import org.springframework.web.bind.annotation.PostMapping; |
24 | | -import org.springframework.web.bind.annotation.RequestBody; |
| 18 | +import java.time.LocalDate; |
| 19 | +import java.time.ZoneId; |
25 | 20 | import org.springframework.web.bind.annotation.RequestMapping; |
26 | 21 | import org.springframework.web.bind.annotation.RequestParam; |
27 | | -import org.springframework.web.bind.annotation.RequestPart; |
28 | 22 | import org.springframework.web.bind.annotation.RestController; |
29 | | -import org.springframework.web.multipart.MultipartFile; |
30 | 23 |
|
31 | 24 | @RestController |
32 | 25 | @RequestMapping("/api/v1/booths") |
33 | 26 | @RequiredArgsConstructor |
34 | 27 | public class BoothApiController implements BoothApiControllerDocs { |
35 | 28 |
|
36 | 29 | private final BoothQueryService boothQueryService; |
37 | | - private final BoothCommandService boothCommandService; |
38 | 30 |
|
39 | 31 | // 가두모집 부스 개수 조회 |
40 | 32 | @Override |
@@ -94,4 +86,19 @@ public ResponseEntity<ApiResponse<List<BoothTop3ResponseDto>>> getTop3BoothRanki |
94 | 86 | List<BoothTop3ResponseDto> result = boothQueryService.getTop3BoothRanking(); |
95 | 87 | return ResponseEntity.ok(ApiResponse.success(result)); |
96 | 88 | } |
| 89 | + |
| 90 | + @GetMapping("/ranking/daily") |
| 91 | + public ResponseEntity<ApiResponse<List<BoothRankingResponseDto>>> getTodayDailyRanking() { |
| 92 | + String today = LocalDate.now(ZoneId.of("Asia/Seoul")).toString(); |
| 93 | + List<BoothRankingResponseDto> result = boothQueryService.getDailyRanking(today); |
| 94 | + return ResponseEntity.ok(ApiResponse.success(result)); |
| 95 | + } |
| 96 | + |
| 97 | + @GetMapping("/ranking/daily/{date}") |
| 98 | + public ResponseEntity<ApiResponse<List<BoothRankingResponseDto>>> getDailyRanking( |
| 99 | + @PathVariable(name = "date") String date |
| 100 | + ) { |
| 101 | + List<BoothRankingResponseDto> result = boothQueryService.getDailyRanking(date); |
| 102 | + return ResponseEntity.ok(ApiResponse.success(result)); |
| 103 | + } |
97 | 104 | } |
0 commit comments