-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from Likelion12/20-be-크루상세조회
Feat : 크루상세조회
- Loading branch information
Showing
18 changed files
with
189 additions
and
24 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/main/java/com/example/likelion12/common/exception/MemberCrewException.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,20 @@ | ||
package com.example.likelion12.common.exception; | ||
|
||
import com.example.likelion12.common.response.status.ResponseStatus; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class MemberCrewException extends RuntimeException { | ||
|
||
private final ResponseStatus exceptionStatus; | ||
|
||
public MemberCrewException(ResponseStatus exceptionStatus) { | ||
super(exceptionStatus.getMessage()); | ||
this.exceptionStatus = exceptionStatus; | ||
} | ||
|
||
public MemberCrewException(ResponseStatus exceptionStatus, String message) { | ||
super(message); | ||
this.exceptionStatus = exceptionStatus; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
.../com/example/likelion12/common/exception_handler/MemberCrewExceptionControllerAdvice.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,23 @@ | ||
package com.example.likelion12.common.exception_handler; | ||
|
||
import com.example.likelion12.common.exception.FacilityException; | ||
import com.example.likelion12.common.exception.MemberCrewException; | ||
import com.example.likelion12.common.response.BaseErrorResponse; | ||
import jakarta.annotation.Priority; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.ExceptionHandler; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
import org.springframework.web.bind.annotation.RestControllerAdvice; | ||
|
||
@Slf4j | ||
@Priority(0) | ||
@RestControllerAdvice | ||
public class MemberCrewExceptionControllerAdvice { | ||
@ResponseStatus(HttpStatus.BAD_REQUEST) | ||
@ExceptionHandler(MemberCrewException.class) | ||
public BaseErrorResponse handle_MemberCrewException(MemberCrewException e) { | ||
log.error("[handle_MemberCrewException]", e); | ||
return new BaseErrorResponse(e.getExceptionStatus(), e.getMessage()); | ||
} | ||
} |
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
3 changes: 1 addition & 2 deletions
3
src/main/java/com/example/likelion12/controller/LoginController.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
4 changes: 2 additions & 2 deletions
4
src/main/java/com/example/likelion12/controller/MemberController.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
43 changes: 43 additions & 0 deletions
43
src/main/java/com/example/likelion12/dto/crew/GetCrewDetailResponse.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,43 @@ | ||
package com.example.likelion12.dto.crew; | ||
|
||
import com.example.likelion12.domain.base.BaseRole; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class GetCrewDetailResponse { | ||
/** | ||
* 크루 상세 조회 response dto | ||
*/ | ||
private BaseRole memberRole; | ||
private String crewName; | ||
private String crewImg; | ||
private String activityRegionName; | ||
private String exerciseName; | ||
private int totalRecruits; | ||
private int crewCost; | ||
private List<Crews> members; | ||
private List<Recommands> recommands; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public static class Crews{ | ||
private String memberImg; | ||
} | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public static class Recommands{ | ||
private Long crewId; | ||
private String crewName; | ||
private String crewImg; | ||
private int crewCost; | ||
private String activityRegionName; | ||
private String exerciseName; | ||
private int currentRecruits; | ||
private int totalRecruits; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...ample/likelion12/dto/PostCrewRequest.java → .../likelion12/dto/crew/PostCrewRequest.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
2 changes: 1 addition & 1 deletion
2
...mple/likelion12/dto/PostCrewResponse.java → ...likelion12/dto/crew/PostCrewResponse.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
2 changes: 1 addition & 1 deletion
2
...example/likelion12/dto/LoginResponse.java → .../likelion12/dto/member/LoginResponse.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
2 changes: 1 addition & 1 deletion
2
...ple/likelion12/dto/PostSignupRequest.java → ...elion12/dto/member/PostSignupRequest.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
2 changes: 1 addition & 1 deletion
2
...le/likelion12/dto/PostSignupResponse.java → ...lion12/dto/member/PostSignupResponse.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
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
6 changes: 6 additions & 0 deletions
6
src/main/java/com/example/likelion12/repository/MemberCrewRepository.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 |
---|---|---|
@@ -1,10 +1,16 @@ | ||
package com.example.likelion12.repository; | ||
|
||
import com.example.likelion12.domain.MemberCrew; | ||
import com.example.likelion12.domain.base.BaseStatus; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
@Repository | ||
public interface MemberCrewRepository extends JpaRepository<MemberCrew, Long> { | ||
|
||
Optional<MemberCrew> findByMember_MemberIdAndCrew_CrewIdAndStatus(Long memberId, Long crewId, BaseStatus status); | ||
Optional<List<MemberCrew>> findByCrew_CrewIdAndStatus(Long crewId, BaseStatus status); | ||
} |
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