Repository navigation
Conversation
게임·트랙 페이지·커리큘럼 서비스 7곳이 "회원 조회 -> Member.canManage 확인"을 각자 복사해 갖고 있었고, 게임 쪽 3곳은 "GAME" 트랙 코드 상수까지 따로 두었다. - TrackAccessGuard.requireManager / requireGameManager 하나로 모은다. - 도메인마다 응답 메시지가 달라 예외 생성자와 "회원 없음"·"권한 없음" 타입은 AccessErrors로 넘긴다. 응답(상태 코드·메시지)과 예외 클래스는 그대로다. - GAME 트랙 행이 없을 때 관리자만 통과하는 기존 동작을 유지한다(canManage(null)).
- 참조가 없는 에러 상수 INVALID_GOOGLE_FORM_URL, INVALID_PHOTO - 호출부가 없는 ReservationGroup.includesWeekday(), SoftDeletableEntity.isDeleted() (isDeleted는 @SQLRestriction 때문에 조회된 엔티티에서 항상 false였다) - 아무도 주입받지 않는 S3Client 빈과 테스트의 목(같은 SDK의 S3Presigner는 계속 쓴다) - 대입만 하고 쓰지 않는 지역 변수 3개(게임 존재 확인 호출은 남긴다) - 존재하지 않는 캐시를 무효화한다는 주석
hibernate.default_batch_fetch_size가 없어, 회원 명부처럼 목록을 돌며 직책(@manytomany)·트랙을 읽는 곳이 회원마다 쿼리를 하나씩 더 보냈다. 회원 21명 관리자 명부 조회가 SQL 40개에서 10개로 준다.
10곳이 새 항목의 display_order를 "현재 행 수"로 정했는데, 삭제가 순서를 다시 매기지 않아 삭제 뒤 새 항목이 기존 항목과 같은 순서를 받았다(예: [0, 2]에 추가하면 2가 겹친다). 같은 순서끼리는 정렬이 정해지지 않아 공개 페이지 순서가 흔들릴 수 있었다. - DisplayOrders.next(형제 목록, 순서 getter): 비어 있으면 0, 아니면 마지막 순서 + 1. - 활동 분류, 커리큘럼·주차·토픽, 게임, 게임·트랙 페이지 부원, 멘토 슬롯, Q&A, 트랙 페이지에 적용한다.
완료 웹훅이 빌드의 현재 상태를 보지 않아, 다시 보내거나 늦게 도착한 웹훅이 보관된 옛 빌드를 다시 활성화하거나(현재 빌드는 보관됨), 활성 빌드를 FAILED로 내릴 수 있었다. - 상태 전이 규칙을 GameBuild에 둔다: ACTIVE·FAILED 반영은 PROCESSING에서만, 아니면 409. 같은 결과의 재전송(ACTIVE->ACTIVE, FAILED->FAILED)은 아무것도 바꾸지 않고 204. - 같은 빌드에 대한 동시 웹훅이 엇갈리지 않게 빌드 행을 잠그고 읽는다.
syncProfileImageFromSlack이 회원 행을 FOR UPDATE로 잠근 트랜잭션 안에서 Slack HTTP를 기다려, 그동안 같은 회원의 로그인·토큰 갱신(같은 행을 잠근다)이 막혔다. - SlackProfileSyncService.syncOne으로 옮겨, 잠금 없이 회원을 읽고 트랜잭션 밖에서 Slack을 부른 뒤 저장만 기존 updatePhotoUrl 트랜잭션으로 한다(전체 동기화 syncAll과 같은 방식). - 응답과 에러는 그대로다.
로그인과 토큰 갱신마다 refresh_token 행이 하나씩 쌓이고, password_reset_token도 지워지지 않았다. 매일 04:00(KST)에 만료된 지 30일이 지난 토큰을 지운다. 만료된 토큰은 갱신 때 재사용 검사보다 먼저 "만료"로 거절되므로 지워도 재사용 감지에는 영향이 없다. 30일 여유는 만료된 쿠키로 요청한 사용자가 "만료" 안내를 받도록 남겨 둔 것이다.
SES와 sendmail 발송기가 같은 제목·텍스트·HTML 템플릿 채우기 코드를 각자 복사해 갖고 있었다. - MailMessages가 메일 내용(MailMessage)을 만들고, TemplateMailSender가 MailSender 메서드를 구현한다. - SES·sendmail 발송기는 deliver(받는 사람, 내용)만 구현한다. - 메일 문구는 글자 하나 바뀌지 않았다(두 발송기의 원래 문자열과 기계적으로 대조).
관리자 이미지(AdminImageService)와 회원 사진(PhotoStorageService)이 키 생성·공개 URL 조립·
presigned PUT 서명 코드를 각자 갖고 있었다.
- global/storage/S3UploadUrlSigner.presignPut(키 접두어, 파일명, 콘텐츠 타입, 크기)로 모은다.
- 키 형식({접두어}/{UUID}.{확장자}), 유효 시간(10분), 크기 서명 여부는 그대로다.
하루 한도 검사가 그날 회원의 기존 예약 행만 잠가, 기존 예약이 없는 날에는 같은 회원의 동시 요청(겹치지 않는 2시간 + 2시간)이 둘 다 통과해 4시간이 예약됐다. - 예약 생성 시 회원 행을 잠가 한 회원의 예약 생성을 직렬화한다. - 반복 예약 저장 중 다른 회원과의 동시 충돌(배타 제약 위반)을 단건과 같이 409로 바꾼다 (이전: 일반 400, 전체 롤백은 동일).
…o chore/merge-train
…nto chore/merge-train
… chore/merge-train
…o chore/merge-train
…to chore/merge-train
…chore/merge-train
…to chore/merge-train
…into chore/merge-train # Conflicts: # src/main/java/com/bcsdlab/bcsdinternalapiv2/curriculum/service/AdminCurriculumService.java
…o chore/merge-train
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
Author
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
머지 대기 PR 10개를 머지 순서(#150→#154→#155→#156→#153→#152→#149→#148→#151→#157)대로 합친 상태를 CI로 한 번에 검증하기 위한 draft PR입니다. 머지하지 않고 검증 후 닫습니다.
AdminCurriculumServiceimport 충돌은 refactor: 트랙 콘텐츠 관리 권한 검사를 TrackAccessGuard로 모은다 #148 쪽(Member·MemberRepository import 제거)과 fix: 새 항목의 표시 순서를 개수가 아닌 마지막 순서 + 1로 정한다 #151 쪽(DisplayOrders import 추가)을 합쳐 해결했습니다.