Conversation
수강신청이 학번 끝자리 홀/짝수로 나뉘어 진행되는데, 기존 타게팅 수단으로는 해당 대상만 추려낼 방법이 없었다. STUDENT_IDS는 학번을 전부 나열해야 해서 실질적으로 사용이 불가능하다. targetType이 아니라 subFilter에 추가한다. targetType은 단일 선택이라 상위로 두면 학과·로그인 여부와 조합할 수 없지만, subFilter는 상위 대상과 교집합으로 적용되므로 "컴퓨터공학부 ∩ 홀수 학번" 같은 조합이 그대로 가능하다. studentId가 String 컬럼이라 캐스팅이나 MOD 없이 마지막 글자를 문자열로 비교한다. 끝자리가 숫자가 아닌 학번은 양쪽 모두에서 제외된다. Claude-Session: https://claude.ai/code/session_01RFpoWznxXnyEpkibznzwUf
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.
Closes #376
무엇을
관리자 푸시 알림(
POST /api/fcm/admin)에 학번 끝자리 홀/짝수 타게팅을 추가한다.왜 subFilter인가
targetType이 아니라 하위subFilter에 넣었다.targetType은 단일 선택이라 상위 그룹으로 두면 학과·로그인 여부와 조합할 수 없다.subFilter는FcmService#getAdminNotificationTargets에서 상위 대상과 교집합으로 적용되므로, "컴퓨터공학부 ∩ 홀수 학번" 조합이 추가 작업 없이 따라온다.변경 사항
AdminNotificationSubFilterSTUDENT_ID_ODD,STUDENT_ID_EVEN추가MemberRepositoryfindIdsByStudentIdEndingOdd(),findIdsByStudentIdEndingEven()추가FcmService#getSubFilterTargetMemberIdsMemberStudentIdParityRepositoryTeststudentId가String컬럼이라 캐스팅·MOD없이 마지막 글자를 문자열로 비교했다.DB 함수 의존이 없어 이식성이 안전하고, 관리자 전용 저빈도 API라 풀스캔 비용도 문제되지 않는다.
엣지 케이스
20200123A)은 홀·짝 양쪽 모두에서 제외 — 테스트로 고정했다.student_id는nullable = false이고nickname이 학번에서 파생되므로 학번 없는 회원은 애초에 존재할 수 없다.테스트
MemberStudentIdParityRepositoryTest3건 통과 (H2,@DataJpaTest).0도 짝수로 포함)연관
웹 관리자 UI: inu-appcenter/inu-portal-web#324
https://claude.ai/code/session_01RFpoWznxXnyEpkibznzwUf