-
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.
✨mission(#6) : setting repository & service
- Loading branch information
Showing
7 changed files
with
55 additions
and
4 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
.../src/main/java/umc/spring/repository/MemberMissionRepository/MemberMissionRepository.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,8 @@ | ||
package umc.spring.repository.MemberMissionRepository; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import umc.spring.domain.mapping.MemberMission; | ||
import umc.spring.repository.StoreRepository.StoreRepositoryCustom; | ||
|
||
public interface MemberMissionRepository extends JpaRepository<MemberMission, Long>, MemberMissionRepositoryCustom { | ||
} |
9 changes: 9 additions & 0 deletions
9
...ain/java/umc/spring/repository/MemberMissionRepository/MemberMissionRepositoryCustom.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,9 @@ | ||
package umc.spring.repository.MemberMissionRepository; | ||
|
||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.Pageable; | ||
import umc.spring.domain.mapping.MemberMission; | ||
|
||
public interface MemberMissionRepositoryCustom { | ||
Page<MemberMission> findMissionsByMemberAndStatus(Long memberId, String status, Long cursor, Pageable pageable); | ||
} |
26 changes: 26 additions & 0 deletions
26
.../main/java/umc/spring/repository/MemberMissionRepository/MemberMissionRepositoryImpl.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,26 @@ | ||
package umc.spring.repository.MemberMissionRepository; | ||
|
||
import com.querydsl.core.BooleanBuilder; | ||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Repository; | ||
import umc.spring.domain.mapping.MemberMission; | ||
import umc.spring.domain.mapping.QMemberMission; | ||
|
||
import java.util.List; | ||
|
||
@Repository | ||
@RequiredArgsConstructor | ||
public class MemberMissionRepositoryImpl implements MemberMissionRepository { | ||
private final JPAQueryFactory jpaQueryFactory; | ||
private final QMemberMission memberMission = QMemberMission.memberMission; | ||
|
||
public List<MemberMission> dynamicQueryWithBooleanBuilder(String name, Float score) { | ||
BooleanBuilder predicate = new BooleanBuilder(); | ||
|
||
return jpaQueryFactory | ||
.selectFrom(memberMission) | ||
.where(predicate) | ||
.fetch(); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
spring/src/main/java/umc/spring/service/MemberMissionService/MemberMissionQueryService.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,4 @@ | ||
package umc.spring.service.MemberMissionService; | ||
|
||
public interface MemberMissionQueryService { | ||
} |
4 changes: 4 additions & 0 deletions
4
.../src/main/java/umc/spring/service/MemberMissionService/MemberMissionQueryServiceImpl.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,4 @@ | ||
package umc.spring.service.MemberMissionService; | ||
|
||
public class MemberMissionQueryServiceImpl implements MemberMissionQueryService { | ||
} |
4 changes: 2 additions & 2 deletions
4
...ice/RegionService/RegionQueryService.java → ...ice/ReviewService/ReviewQueryService.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