66import jakarta .validation .Valid ;
77import lombok .RequiredArgsConstructor ;
88import org .springdoc .core .annotations .ParameterObject ;
9- import org .springframework .data .domain .Pageable ;
10- import org .springframework .data .web .PageableDefault ;
119import org .springframework .http .HttpStatus ;
1210import org .springframework .http .MediaType ;
1311import org .springframework .security .core .annotation .AuthenticationPrincipal ;
1412import org .springframework .web .bind .annotation .*;
1513import targeter .aim .domain .challenge .dto .ChallengeDto ;
1614import targeter .aim .domain .challenge .entity .ChallengeMode ;
17- import targeter .aim .domain .challenge .repository .AllChallengeSortType ;
18- import targeter .aim .domain .challenge .repository .SortOrder ;
1915import targeter .aim .domain .challenge .service .ChallengeService ;
2016import targeter .aim .system .security .annotation .NoJwtAuth ;
2117import targeter .aim .system .security .model .UserDetails ;
@@ -44,33 +40,6 @@ public ChallengeDto.ChallengeIdResponse createChallenge(
4440 return challengeService .createChallenge (userDetails , request );
4541 }
4642
47- @ NoJwtAuth
48- @ GetMapping ("/vs" )
49- @ Operation (
50- summary = "VS 챌린지 목록 조회" ,
51- description = "VS 챌린지 목록을 탭(ALL/MY)과 정렬 조건에 따라 페이지네이션 조회합니다."
52- )
53- public ChallengeDto .ChallengePageResponse getVsChallenges (
54- @ ModelAttribute @ ParameterObject ChallengeDto .ListSearchCondition condition ,
55- @ PageableDefault (size = 16 ) @ ParameterObject Pageable pageable ,
56- @ AuthenticationPrincipal UserDetails userDetails
57- ) {
58- return challengeService .getVsChallenges (condition , userDetails , pageable );
59- }
60-
61- @ NoJwtAuth ("VS 챌린지 상세 조회는 인증을 필요로 하지 않음" )
62- @ GetMapping ("/vs/{challengeId}/overview" )
63- @ Operation (
64- summary = "VS 챌린지 상세 Overview 조회" ,
65- description = "특정 VS 챌린지의 상세 정보와 우세현황 및 챌린지 멤버 정보를 조회합니다."
66- )
67- public ChallengeDto .VsChallengeOverviewResponse getVsChallengeOverview (
68- @ PathVariable Long challengeId ,
69- @ AuthenticationPrincipal UserDetails userDetails
70- ) {
71- return challengeService .getVsChallengeOverview (challengeId , userDetails );
72- }
73-
7443 @ NoJwtAuth ("VS 결과는 비로그인 유저도 열람 가능" )
7544 @ GetMapping ("/vs/{challengeId}/result" )
7645 @ Operation (
@@ -83,30 +52,6 @@ public ChallengeDto.VsResultResponse getVsResult(
8352 return challengeService .getVsChallengeResult (challengeId );
8453 }
8554
86- @ GetMapping ("/solo" )
87- @ Operation (
88- summary = "SOLO 챌린지 목록 조회" ,
89- description = "로그인한 사용자가 SOLO 챌린지 목록을 탭(진행 중/진행 완료)과 정렬 조건에 따라 페이지네이션 조회합니다."
90- )
91- public ChallengeDto .ChallengePageResponse getSoloChallenges (
92- @ ModelAttribute @ ParameterObject ChallengeDto .SoloChallengeListRequest request ,
93- @ AuthenticationPrincipal UserDetails userDetails
94- ) {
95- return challengeService .getSoloChallenges (request , userDetails );
96- }
97-
98- @ GetMapping ("/solo/{challengeId}/overview" )
99- @ Operation (
100- summary = "SOLO 챌린지 상세 Overview 조회" ,
101- description = "로그인한 사용자가 특정 SOLO 챌린지의 상세 정보와 주최자 진행 현황을 조회합니다."
102- )
103- public ChallengeDto .SoloChallengeOverviewResponse getSoloChallengeOverview (
104- @ PathVariable Long challengeId ,
105- @ AuthenticationPrincipal UserDetails userDetails
106- ) {
107- return challengeService .getSoloChallengeOverview (challengeId , userDetails );
108- }
109-
11055 @ PatchMapping (value = "/{challengeId}" , consumes = MediaType .MULTIPART_FORM_DATA_VALUE )
11156 @ Operation (
11257 summary = "챌린지 수정" ,
@@ -146,27 +91,6 @@ public List<ChallengeDto.ChallengeToPostResponse> getChallengeForPost(
14691 return challengeService .getChallengeToPost (mode , userDetails );
14792 }
14893
149- @ GetMapping ("/all" )
150- @ Operation (
151- summary = "ALL 챌린지 목록 조회" ,
152- description = "로그인한 사용자가 참여한 모든 SOLO/VS 챌린지를 정렬 조건과 함께 조회합니다."
153- )
154- public ChallengeDto .ChallengePageResponse getAllChallenges (
155- @ AuthenticationPrincipal UserDetails userDetails ,
156- @ RequestParam (defaultValue = "CREATED_AT" ) AllChallengeSortType sort ,
157- @ RequestParam (defaultValue = "DESC" ) SortOrder order ,
158- @ PageableDefault (size = 8 ) @ ParameterObject Pageable pageable
159- ) {
160- var page = challengeService .getAllChallenges (
161- userDetails ,
162- pageable ,
163- sort ,
164- order
165- );
166-
167- return ChallengeDto .ChallengePageResponse .from (page );
168- }
169-
17094 @ GetMapping ("/records" )
17195 @ Operation (
17296 summary = "유저 챌린지 기록 조회" ,
0 commit comments