6
6
import io .swagger .v3 .oas .annotations .tags .Tag ;
7
7
import lombok .RequiredArgsConstructor ;
8
8
import muit .backend .apiPayLoad .ApiResponse ;
9
+ import muit .backend .domain .enums .SectionType ;
9
10
import muit .backend .dto .adminDTO .manageViewDTO .ManageViewResponseDTO ;
11
+ import muit .backend .dto .sectionDTO .SectionRequestDTO ;
12
+ import muit .backend .dto .sectionDTO .SectionResponseDTO ;
10
13
import muit .backend .dto .theatreDTO .TheatreResponseDTO ;
11
14
import muit .backend .service .theatreService .TheatreService ;
12
15
import org .springframework .data .domain .Page ;
13
16
import org .springframework .data .domain .PageRequest ;
14
17
import org .springframework .data .domain .Pageable ;
15
18
import org .springframework .data .domain .Sort ;
19
+ import org .springframework .http .MediaType ;
16
20
import org .springframework .web .bind .annotation .*;
21
+ import org .springframework .web .multipart .MultipartFile ;
22
+
23
+ import javax .print .attribute .standard .Media ;
17
24
18
25
@ Tag (name = "어드민이 시야 관리" )
19
26
@ RestController
@@ -31,11 +38,48 @@ public ApiResponse<ManageViewResponseDTO.AdminTheatreResultListDTO> getTheatres(
31
38
}
32
39
33
40
@ GetMapping ("/{theatreId}" )
34
- @ Operation (summary = "시야 관리에서 특정 공연장 상세 화면" , description = "시야 관리 - 상세 버튼 클릭 - 해당 공연장의 좌석 정보를 조회하는 API" )
41
+ @ Operation (summary = "시야 관리에서 특정 공연장 상세 화면" , description = "시야 관리 - 상세 버튼 클릭 - 해당 공연장의 정보를 조회하는 API" )
35
42
@ Parameters ({
36
43
@ Parameter (name = "theatreId" , description = "시야 관리할 공연장 ID 입력" )
37
44
})
38
45
public ApiResponse <TheatreResponseDTO .AdminTheatreDetailDTO > getTheatre (@ PathVariable ("theatreId" ) Long theatreId ){
39
46
return ApiResponse .onSuccess (theatreService .getTheatreDetail (theatreId ));
40
47
}
48
+
49
+ @ GetMapping ("/{theatreId}/section" )
50
+ @ Operation (summary = "시야 관리에서 특정 공연장 상세 화면에서 섹션 선택" , description = "시야 관리 - 상세 - 섹션(A,B,C,D ..)의 좌석정보를 조회하는 API" )
51
+ @ Parameters ({
52
+ @ Parameter (name = "theatreId" , description = "시야 관리할 공연장 ID 입력" ),
53
+ @ Parameter (name = "sectionType" , description = "좌석 정보를 조회할 섹션 선택" )
54
+ })
55
+ public ApiResponse <SectionResponseDTO .SectionResultDTO > getSection (@ PathVariable ("theatreId" ) Long theatreId , @ RequestParam SectionType sectionType ){
56
+ return ApiResponse .onSuccess (theatreService .getSection (theatreId , sectionType ));
57
+ }
58
+
59
+ @ GetMapping ("{theatreId}/edit" )
60
+ @ Operation (summary = "공연장 정보 조회" , description = "시야관리 - 상세 - 수정하기 : 공연장 정보(전체사진, 섹션 정보) 조회" )
61
+ public ApiResponse <TheatreResponseDTO .AdminTheatreSectionListDTO > getTheatreSections (@ PathVariable ("theatreId" ) Long theatreId ){
62
+ return ApiResponse .onSuccess (theatreService .getTheatreSections (theatreId ));
63
+ }
64
+
65
+ @ PatchMapping (value = "/{theatreId}/edit/theatrePic" , consumes = MediaType .MULTIPART_FORM_DATA_VALUE )
66
+ @ Operation (summary = "공연장 전체 사진 등록/수정" , description = "시야관리 - 상세 - 수정하기 - 공연장 전체사진 수정 - 사진첨부 - 등록하기 : 공연장 전체사진 등록" )
67
+ @ Parameter (name = "theatreId" , description = "사진을 등록할 공연장 Id 입력" )
68
+ public ApiResponse <TheatreResponseDTO .TheatreResultDTO > uploadTheatrePic (@ PathVariable ("theatreId" ) Long theatreId , @ RequestPart (value = "img" , required = false ) MultipartFile img ){
69
+ return ApiResponse .onSuccess (theatreService .uploadTheatrePic (theatreId , img ));
70
+ }
71
+
72
+ @ PostMapping (value = "/{theatreId}/edit/addSec" , consumes = MediaType .MULTIPART_FORM_DATA_VALUE )
73
+ @ Operation (summary = "섹션 정보 등록하기" , description = "시야관리 - 상세 - 수정하기 - 추가하기 - 정보, 사진 등록 - 등록하기 : 섹션 정보 및 사진 등록" )
74
+ public ApiResponse <SectionResponseDTO .SectionResultDTO > addSection (@ PathVariable ("theatreId" ) Long theatreId , @ RequestPart ("requestDTO" ) SectionRequestDTO .SectionCreateDTO requestDTO , @ RequestPart (value = "img" , required = false ) MultipartFile img ){
75
+ return ApiResponse .onSuccess (theatreService .createSection (theatreId , requestDTO , img ));
76
+ }
77
+
78
+ @ PatchMapping (value = "/{sectionId}" , consumes = MediaType .MULTIPART_FORM_DATA_VALUE )
79
+ @ Operation (summary = "기존 섹션 정보 수정하기" , description = "시야관리 - 상세 - 수정하기 - 수정, 미등록 버튼 : 섹션 정보 수정" )
80
+ public ApiResponse <SectionResponseDTO .SectionResultDTO > editSection (@ PathVariable ("sectionId" ) Long sectionId , @ RequestPart ("requestDTO" ) SectionRequestDTO .SectionCreateDTO requestDTO , @ RequestPart (value = "img" , required = false ) MultipartFile img ){
81
+ return ApiResponse .onSuccess (theatreService .editSection (sectionId , requestDTO , img ));
82
+ }
83
+
84
+
41
85
}
0 commit comments