Repository navigation
[Feat/#146] 사물함 상태 일괄 변경 관리자 API 추가 #148
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
Open
sangrae2325
wants to merge
12
commits into
feat/#132-admin-locker-sections
from
feat/#146-admin-locker-status
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f9a9030
feat: 사물함 상태 변경 도메인 동작 추가
sangrae2325 5bcfc2e
feat: 사물함 상태 변경 저장소 경로 추가
sangrae2325 4c5b2ef
feat: 사물함 상태 일괄 변경 서비스 추가
sangrae2325 9654f0c
feat: 사물함 상태 일괄 변경 관리자 API 추가
sangrae2325 e39dca0
refactor: 사물함 상태 변경 응답을 없애고 변경 동작을 단순화
sangrae2325 5022171
refactor: 사물함 사용 가능 판정을 LockerStatus.isUsable로 모음
sangrae2325 a54d64c
refactor: 사물함 이용 중 판정을 회차 먼저 좁히는 순서로 변경
sangrae2325 e09fccc
refactor: 사물함 상태 변경 서비스의 private 메서드명을 파일 관행에 맞춤
sangrae2325 92b7df2
fix: 사물함 상태 변경이 삭제 표시를 되돌리지 않도록 @DynamicUpdate 적용
sangrae2325 09061da
fix: 사물함 상태 변경 요청의 중복 식별자 제거
sangrae2325 5cb627d
fix: 사물함 상태 변경에서 없는 구역을 404로 응답하고 요청한 사물함만 조회
sangrae2325 d20a6ad
docs: 사물함 상태 변경이 못 막는 경합과 배정 집계 근거 정리
sangrae2325 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
28 changes: 28 additions & 0 deletions
28
...n/java/kr/ac/kookmin/stream/api/admin/event/locker/request/LockerStatusChangeRequest.java
This file contains hidden or 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,28 @@ | ||
| package kr.ac.kookmin.stream.api.admin.event.locker.request; | ||
|
|
||
| import jakarta.validation.constraints.NotEmpty; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import java.util.List; | ||
| import kr.ac.kookmin.stream.event.domain.locker.domain.LockerStatus; | ||
|
|
||
| /** | ||
| * 구역 안의 사물함 여러 개를 같은 상태로 바꾼다. | ||
| * <p> | ||
| * 구역 상세가 내려주는 {@code ASSIGNED}는 신청으로 생기는 표시용 값이라 이 경로로는 바꿀 수 없다. | ||
| */ | ||
| public record LockerStatusChangeRequest( | ||
| @NotEmpty(message = "사물함을 하나 이상 선택해 주세요.") | ||
| List<@NotNull(message = "사물함 ID는 비워 둘 수 없습니다.") Long> lockerIds, | ||
|
sangrae2325 marked this conversation as resolved.
|
||
|
|
||
| @NotNull(message = "변경할 상태를 입력해 주세요.") | ||
| LockerStatus lockerStatus | ||
| ) { | ||
|
|
||
| /** | ||
| * 중복을 걷어낸 사물함 식별자. 같은 칸이 여러 번 와도 결과는 같지만, 그대로 두면 이용 중 검사의 {@code IN} 절이 | ||
| * 구역의 칸 수보다 커진다. 중복을 없애면 상한이 그 구역의 칸 수가 되어 따로 숫자를 둘 필요가 없다. | ||
| */ | ||
| public List<Long> distinctLockerIds() { | ||
| return lockerIds.stream().distinct().toList(); | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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
12 changes: 11 additions & 1 deletion
12
...ain/event/src/main/java/kr/ac/kookmin/stream/event/domain/locker/domain/LockerStatus.java
This file contains hidden or 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,6 +1,16 @@ | ||
| package kr.ac.kookmin.stream.event.domain.locker.domain; | ||
|
|
||
| /** 사물함 자체의 물리 상태. 회차 배정 여부는 담지 않는다. */ | ||
| public enum LockerStatus { | ||
|
|
||
| AVAILABLE, | ||
| DISABLED | ||
| DISABLED; | ||
|
|
||
| /** | ||
| * 학생에게 내줄 수 있는 상태인지. 쓸 수 있는 상태를 허용 목록으로 두어, 나중에 상태가 늘어도 그 값이 자동으로 | ||
| * "쓸 수 없음"에 들어가게 한다. 상태를 차단 목록으로 보는 곳이 생기면 새 값만 조용히 빠져나간다. | ||
| */ | ||
| public boolean isUsable() { | ||
| return this == AVAILABLE; | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.