-
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.
Feat : AccessService 구현(존재하는 Academy인지 확인 쿼리 및 교육비 조회 쿼리)
- Loading branch information
Showing
5 changed files
with
42 additions
and
6 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
src/main/java/org/guzzing/studayserver/domain/academy/repository/AcademyFee.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,10 @@ | ||
package org.guzzing.studayserver.domain.academy.repository; | ||
|
||
public interface AcademyFee { | ||
|
||
Long getMaxEducationFee(); | ||
|
||
String getAcademyName(); | ||
|
||
|
||
} |
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
11 changes: 9 additions & 2 deletions
11
src/main/java/org/guzzing/studayserver/domain/academy/service/AcademyAccessServiceImpl.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,20 +1,27 @@ | ||
package org.guzzing.studayserver.domain.academy.service; | ||
|
||
import org.guzzing.studayserver.domain.academy.repository.academy.AcademyRepository; | ||
import org.guzzing.studayserver.domain.like.service.dto.response.AcademyFeeInfo; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
public class AcademyAccessServiceImpl implements | ||
AcademyAccessService { | ||
|
||
private final AcademyRepository academyRepository; | ||
|
||
public AcademyAccessServiceImpl(AcademyRepository academyRepository) { | ||
this.academyRepository = academyRepository; | ||
} | ||
|
||
@Override | ||
public AcademyFeeInfo findAcademyFeeInfo(Long academyId) { | ||
return null; | ||
return AcademyFeeInfo.to(academyRepository.findAcademyFeeInfo(academyId)); | ||
} | ||
|
||
@Override | ||
public boolean existsAcademy(Long academyId) { | ||
return false; | ||
return academyRepository.existsByAcademyId(academyId); | ||
} | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/org/guzzing/studayserver/domain/like/service/dto/response/AcademyFeeInfo.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,17 @@ | ||
package org.guzzing.studayserver.domain.like.service.dto.response; | ||
|
||
import org.guzzing.studayserver.domain.academy.repository.AcademyFee; | ||
|
||
public record AcademyFeeInfo( | ||
String academyName, | ||
long expectedFee | ||
) { | ||
|
||
public static AcademyFeeInfo to(AcademyFee academyFee) { | ||
return new AcademyFeeInfo( | ||
academyFee.getAcademyName(), | ||
academyFee.getMaxEducationFee() | ||
); | ||
} | ||
|
||
} |