Repository navigation
[Feat/#198] 홈 화면이 쓸 조회 경로 추가 #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
69effd8
fd3d935
39efe1b
6d36dff
e65cd1c
2924754
d8ce2fc
930413f
936e9a5
c4d671e
0519ac7
c9f72dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| package kr.ac.kookmin.stream.common; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| /** | ||
| * 앞의 몇 건과 전체 수. 홈처럼 "미리보기 N건 + 더보기"를 그리는 화면이 쓴다. | ||
| * <p> | ||
| * 커서({@link CursorSliceResult})나 페이지({@link PageResult})와 달리 이어서 더 읽지 않는다. 전체를 돌려주고 | ||
| * 화면이 자르면 목록이 긴 회원의 홈에 이력 전체가 실리므로, 자르는 일을 조회가 맡고 전체 수를 함께 준다. | ||
| * | ||
| * @param content 미리보기 목록. 전체 수보다 적을 수 있다 | ||
| */ | ||
| public record PreviewResult<T>(List<T> content, long totalCount) { | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| package kr.ac.kookmin.stream.event.domain.locker.service; | ||
|
|
||
| import java.util.Collection; | ||
| import java.util.List; | ||
| import java.util.Map; | ||
| import java.util.Optional; | ||
|
|
@@ -16,6 +17,12 @@ public interface LockerService { | |
| */ | ||
| Optional<LockerPeriod> getCurrentPeriod(); | ||
|
|
||
| /** | ||
| * 주어진 운영 회차 중 지금 신청할 수 있는 것을 신청 마감 임박순으로 조회한다. | ||
| * 미게시·삭제된 회차와 신청 기간이 아닌 회차는 빠진다. | ||
| */ | ||
| List<LockerPeriod> getApplicablePeriods(Collection<Long> lockerPeriodIds); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
식별자를 받는 모양 좋아 보여요. 홈은 노출 설정에서 회차를 이미 알고 있고, 신청 내역( 비대칭은 이미 풀린 것 같아요. 본문 한계에 적어 주신 대로 #200에서 신청 가능한 행사 조회를 #200에 두신 것도 괜찮아 보여요.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 본문 리뷰 포인트에서 비대칭 설명을 빼고, 신청 가능한 행사 조회를 #200에 둔 경위로 고쳐 적었습니다. 지적해 주신 대로 그 설명이 |
||
|
|
||
| /** | ||
| * 운영 회차의 구역별 전체/선택 가능 사물함 수와 표시 상태를 조회한다. | ||
| */ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[a]리뷰 포인트 주신PreviewResult를core:common에 둔 것에 대한 의견이에요.하나 더 두는 게 맞아 보여요.
core:domain:event)와 대여(core:domain:welfare)가 같이 쓰는데, 도메인 모듈끼리는 서로 의존하지 않으니(architecture.md3절) 둘 곳은core:common뿐이에요. 2-1절 표에도core:common이 맡는 것으로 "페이지/커서 결과"가 있어서 그 옆에 놓이는 타입입니다PageResult로 대신하면page·size·totalPage가 뜻 없는 값으로 나가요. 목록과 전체 수를 서비스 메서드 둘로 나누면, 조회 조합 UseCase에는 트랜잭션을 걸지 않으니(coding-style.md2-9절)getUpcomingAppliedEvents에서 한 스냅샷으로 묶어 두신 게 풀립니다PageResult의content·totalCount와 같아서 프론트가 같은 이름으로 읽을 수 있는 것도 좋아요There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0519ac7 말씀하신 대로 목록과 전체 수를 서비스 메서드 둘로 두면 2-9절 때문에 한 스냅샷 보장이 풀려서, 저장소에서 countQuery로 한 번에 읽고 readOnly 트랜잭션을 뺐습니다.
PreviewResult는 그대로core:common에 두었습니다.