-
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.
Merge pull request #91 from KCY-Fit-a-Pet/feat/83
โจ ๊ธฐ๋ก ์กฐํ ๋ฐ ์์ฑ API & Util ๋ฐ ์ฌ์ฉ์ ์ ์ ํจ์ ์ ์ฉ
- Loading branch information
Showing
71 changed files
with
1,677 additions
and
159 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
5 changes: 2 additions & 3 deletions
5
src/main/java/com/kcy/fitapet/domain/care/dao/CareCategoryRepository.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,11 +1,10 @@ | ||
package com.kcy.fitapet.domain.care.dao; | ||
|
||
import com.kcy.fitapet.domain.care.domain.CareCategory; | ||
import com.kcy.fitapet.global.common.repository.ExtendedRepository; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import com.kcy.fitapet.global.common.repository.ExtendedJpaRepository; | ||
|
||
import java.util.List; | ||
|
||
public interface CareCategoryRepository extends ExtendedRepository<CareCategory, Long> { | ||
public interface CareCategoryRepository extends ExtendedJpaRepository<CareCategory, Long> { | ||
List<CareCategory> findAllByPet_Id(Long petId); | ||
} |
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
5 changes: 2 additions & 3 deletions
5
src/main/java/com/kcy/fitapet/domain/care/dao/CareRepository.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,8 +1,7 @@ | ||
package com.kcy.fitapet.domain.care.dao; | ||
|
||
import com.kcy.fitapet.domain.care.domain.Care; | ||
import com.kcy.fitapet.global.common.repository.ExtendedRepository; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import com.kcy.fitapet.global.common.repository.ExtendedJpaRepository; | ||
|
||
public interface CareRepository extends ExtendedRepository<Care, Long> { | ||
public interface CareRepository extends ExtendedJpaRepository<Care, Long> { | ||
} |
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
5 changes: 2 additions & 3 deletions
5
src/main/java/com/kcy/fitapet/domain/member/dao/ManagerRepository.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,12 +1,11 @@ | ||
package com.kcy.fitapet.domain.member.dao; | ||
|
||
import com.kcy.fitapet.domain.member.domain.Manager; | ||
import com.kcy.fitapet.global.common.repository.ExtendedRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import com.kcy.fitapet.global.common.repository.ExtendedJpaRepository; | ||
|
||
import java.util.List; | ||
|
||
public interface ManagerRepository extends ExtendedRepository<Manager, Long> { | ||
public interface ManagerRepository extends ExtendedJpaRepository<Manager, Long> { | ||
boolean existsByMember_IdAndPet_Id(Long memberId, Long petId); | ||
List<Manager> findAllByMember_Id(Long memberId); | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/kcy/fitapet/domain/member/dao/MemberQueryDslRepository.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,7 @@ | ||
package com.kcy.fitapet.domain.member.dao; | ||
|
||
import java.util.List; | ||
|
||
public interface MemberQueryDslRepository { | ||
List<Long> findMyPetIds(Long memberId); | ||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/com/kcy/fitapet/domain/member/dao/MemberQueryDslRepositoryImpl.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,29 @@ | ||
package com.kcy.fitapet.domain.member.dao; | ||
|
||
import com.kcy.fitapet.domain.member.domain.QManager; | ||
import com.kcy.fitapet.domain.member.domain.QMember; | ||
import com.kcy.fitapet.domain.pet.domain.QPet; | ||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.List; | ||
|
||
@Repository | ||
@RequiredArgsConstructor | ||
public class MemberQueryDslRepositoryImpl implements MemberQueryDslRepository { | ||
private final JPAQueryFactory queryFactory; | ||
private final QMember member = QMember.member; | ||
private final QManager manager = QManager.manager; | ||
private final QPet pet = QPet.pet; | ||
|
||
@Override | ||
public List<Long> findMyPetIds(Long memberId) { | ||
return queryFactory.select(pet.id) | ||
.from(member) | ||
.leftJoin(manager).on(manager.member.id.eq(member.id)) | ||
.leftJoin(pet).on(pet.id.eq(manager.pet.id)) | ||
.where(member.id.eq(memberId)) | ||
.fetch(); | ||
} | ||
} |
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
Oops, something went wrong.