-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`WaitingManager`에 남은 순번 조회를 위한 추상 메서드를 정의함.
- Loading branch information
1 parent
00868e1
commit 5dc4016
Showing
4 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/main/java/com/thirdparty/ticketing/domain/waiting/WaitingController.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,29 @@ | ||
package com.thirdparty.ticketing.domain.waiting; | ||
|
||
import java.util.Map; | ||
|
||
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.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.thirdparty.ticketing.domain.common.LoginMember; | ||
import com.thirdparty.ticketing.domain.waiting.manager.WaitingManager; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api") | ||
public class WaitingController { | ||
|
||
private final WaitingManager waitingManager; | ||
|
||
@GetMapping("/performances/{performanceId}/wait") | ||
public ResponseEntity<Map<String, Long>> getCounts( | ||
@LoginMember String email, @PathVariable("performanceId") Long performanceId) { | ||
long remainingCount = waitingManager.getRemainingCount(email, performanceId); | ||
return ResponseEntity.ok(Map.of("remainingCount", remainingCount)); | ||
} | ||
} |
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