11package com .waitit .capstone .domain .admin ;
22
3- import com .waitit .capstone .domain .admin .dto .AllHostRequest ;
4- import com .waitit .capstone .domain .admin .dto .AllUserRequest ;
5- import com .waitit .capstone .domain .admin .dto .HostSummaryDto ;
6- import com .waitit .capstone .domain .admin .dto .UpdatedRequest ;
3+ import com .waitit .capstone .domain .admin .dto .*; // DTO 임포트
74import com .waitit .capstone .domain .image .AllImageResponse ;
85import com .waitit .capstone .domain .image .ImageService ;
96import com .waitit .capstone .domain .queue .dto .QueueDto ;
2118import org .springframework .http .MediaType ;
2219import org .springframework .http .ResponseEntity ;
2320import org .springframework .security .access .prepost .PreAuthorize ;
24- import org .springframework .web .bind .annotation .DeleteMapping ;
25- import org .springframework .web .bind .annotation .GetMapping ;
26- import org .springframework .web .bind .annotation .PatchMapping ;
27- import org .springframework .web .bind .annotation .PathVariable ;
28- import org .springframework .web .bind .annotation .PostMapping ;
29- import org .springframework .web .bind .annotation .RequestBody ;
30- import org .springframework .web .bind .annotation .RequestMapping ;
31- import org .springframework .web .bind .annotation .RequestParam ;
32- import org .springframework .web .bind .annotation .RestController ;
21+ import org .springframework .web .bind .annotation .*;
3322import org .springframework .web .multipart .MultipartFile ;
3423
3524
@@ -42,6 +31,7 @@ public class AdminController {
4231 private final AdminService adminService ;
4332 private final ImageService imageService ;
4433
34+ // ... (기존 회원 관련 API 생략)
4535 @ Operation (summary = "모든 회원 조회" , description = "관리자가 모든 회원을 페이지별로 조회합니다." )
4636 @ GetMapping ("/users" )
4737 @ PreAuthorize ("hasRole('ADMIN')" )
@@ -56,10 +46,8 @@ public ResponseEntity<PageResponse<AllUserRequest>> getAll(@RequestParam(default
5646 @ PreAuthorize ("hasRole('ADMIN')" )
5747 public ResponseEntity <?> updateUser (@ RequestBody UpdatedRequest request ){
5848 adminService .updateMember (request );
59-
6049 Map <String ,String > map = new HashMap <>();
6150 map .put ("message" ,"회원정보가 수정되었습니다." );
62-
6351 return ResponseEntity .ok (map );
6452 }
6553
@@ -68,13 +56,12 @@ public ResponseEntity<?> updateUser(@RequestBody UpdatedRequest request){
6856 @ PreAuthorize ("hasRole('ADMIN')" )
6957 public ResponseEntity <?> deleteUser (@ PathVariable Long id ){
7058 adminService .deleteMember (id );
71-
7259 Map <String ,String > map = new HashMap <>();
7360 map .put ("message" ,"회원이 삭제되었습니다." );
74-
7561 return ResponseEntity .ok (map );
7662 }
7763
64+
7865 @ Operation (summary = "이벤트 배너 등록" , description = "관리자가 이벤트 배너 이미지를 업로드합니다." )
7966 @ PostMapping (value = "/event/upload" , consumes = MediaType .MULTIPART_FORM_DATA_VALUE )
8067 @ PreAuthorize ("hasRole('ADMIN')" )
@@ -92,21 +79,23 @@ public ResponseEntity<PageResponse<AllImageResponse>> getAllImages(
9279 PageResponse <AllImageResponse > images = imageService .getAllImage (pageable );
9380 return ResponseEntity .ok (images );
9481 }
82+
9583 @ Operation (summary = "이벤트 배너 삭제" , description = "관리자가 특정 이벤트 배너를 삭제합니다." )
9684 @ DeleteMapping ("/event/{id}" )
9785 public ResponseEntity <?> deleteEvent (@ PathVariable Long id ){
9886 adminService .deleteImage (id );
9987 return ResponseEntity .status (HttpStatus .OK ).body ("이미지 삭제 완료" );
10088 }
10189
102- @ Operation (summary = "메인 이벤트 배너 선택 " , description = "관리자가 메인 화면에 표시할 이벤트 배너를 선택합니다 ." )
90+ @ Operation (summary = "메인 배너 상태 변경 (ON/OFF) " , description = "관리자가 메인 화면에 표시할 배너를 활성화(ON) 또는 비활성화(OFF)합니다 ." )
10391 @ PreAuthorize ("hasRole('ADMIN')" )
104- @ PostMapping ("/event/select " )
105- public ResponseEntity <?> selectEventBanner ( @ RequestParam Long imgId , @ RequestParam int number ) {
106- adminService .selectBanner ( imgId , number );
107- return ResponseEntity .status ( HttpStatus . OK ). body ( "이미지 이벤트 등록 완료" );
92+ @ PostMapping ("/banners/status " )
93+ public ResponseEntity <Void > updateBannerStatus ( @ RequestBody UpdateBannerStatusRequest request ) {
94+ adminService .updateBannerStatus ( request );
95+ return ResponseEntity .ok (). build ( );
10896 }
10997
98+ // ... (기존 대기열 및 호스트 관련 API 생략)
11099 @ Operation (summary = "활성 대기열 현황 조회" , description = "관리자가 현재 활성화된 모든 대기열의 요약 정보를 조회합니다." )
111100 @ PreAuthorize ("hasRole('ADMIN')" )
112101 @ GetMapping ("/active" )
0 commit comments