-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Feat]: 진행중인 챌린지 조회 구현 완료
- Loading branch information
Showing
12 changed files
with
183 additions
and
55 deletions.
There are no files selected for viewing
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
36 changes: 0 additions & 36 deletions
36
...rc/main/java/org/haedal/zzansuni/domain/challengegroup/challenge/ChallengeCurrentDto.java
This file was deleted.
Oops, something went wrong.
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
7 changes: 7 additions & 0 deletions
7
...ain/java/org/haedal/zzansuni/domain/challengegroup/userchallenge/UserChallengeReader.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,15 +1,22 @@ | ||
package org.haedal.zzansuni.domain.challengegroup.userchallenge; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Optional; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
|
||
public interface UserChallengeReader { | ||
|
||
UserChallenge getById(Long id); | ||
|
||
UserChallenge getByIdWithVerificationAndChallenge(Long id); | ||
|
||
Optional<UserChallenge> findById(Long id); | ||
|
||
UserChallenge getByUserIdAndChallengeId(Long userId, Long challengeId); | ||
|
||
Optional<UserChallenge> findByUserIdAndChallengeId(Long userId, Long challengeId); | ||
|
||
Page<UserChallenge> getPageByUserId(Long userId, Pageable pageable); | ||
} |
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
17 changes: 11 additions & 6 deletions
17
...java/org/haedal/zzansuni/infrastructure/challengegroup/challenge/ChallengeRepository.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,15 +1,20 @@ | ||
package org.haedal.zzansuni.infrastructure.challengegroup.challenge; | ||
|
||
import org.haedal.zzansuni.controller.challengegroup.challenge.ChallengeRes.ChallengeCurrentResponse; | ||
import org.haedal.zzansuni.domain.challengegroup.challenge.Challenge; | ||
import org.haedal.zzansuni.domain.challengegroup.challenge.ChallengeCurrentDto; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
public interface ChallengeRepository extends JpaRepository<Challenge, Long> { | ||
|
||
// /** | ||
// * userId로 현재 진행중인 챌린지 조회 <br> userId로 챌린지를 가져온다. | ||
// */ | ||
// @Query( | ||
// "SELECT new org.haedal.zzansuni.infrastructure.challengegroup.challenge.dto.ChallengeCurrentDto(" | ||
// + "c.id, c.title, ," | ||
// + " c.startDate, c.endDate," | ||
// + " c.participantCount, c.participantLimit, c.status, c.user.id, c.user.nickname, c.user.profileImage) " | ||
// + "FROM Challenge c WHERE c.user.id = :userId") | ||
// Page<ChallengeCurrentDto> findAllChallengeCurrent(Long userId, Pageable pageable); | ||
|
||
} | ||
|
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: 3 additions & 0 deletions
3
...dal/zzansuni/infrastructure/challengegroup/challengereview/ChallengeReviewRepository.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,13 @@ | ||
package org.haedal.zzansuni.infrastructure.challengegroup.challengereview; | ||
|
||
import java.util.List; | ||
import java.util.Optional; | ||
import org.haedal.zzansuni.domain.challengegroup.challengereview.ChallengeReview; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface ChallengeReviewRepository extends JpaRepository<ChallengeReview, Long> { | ||
|
||
Optional<ChallengeReview> findByUserChallengeId(Long userChallengeId); | ||
|
||
List<ChallengeReview> findByUserChallengeIdIn(List<Long> userChallengeIds); | ||
} |
Oops, something went wrong.