-
Notifications
You must be signed in to change notification settings - Fork 0
[π merge] λΈλ μΉλ€κ° μΆ©λ ν΄κ²° #57
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
Merged
Merged
Conversation
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
μ¬μ©μκ° μλ‘ λ°κΈλ°μ FCM ν ν°μ μλ²μ μ λ¬νμ¬ μ
λ°μ΄νΈν μ μλ POST /api/v1/users/{userId}/fcm-tokens μλν¬μΈνΈλ₯Ό μΆκ°νμμ΅λλ€.
- μμ² μ μ ν ν°μ UserServiceλ‘ μ λ¬ν΄ κ°±μ μ²λ¦¬
- μ±κ³΅ μ HTTP 201 μνμ FCM_TOKEN_UPDATED μ±κ³΅ μ½λλ₯Ό λ°ν
μ¬μ©μμ FCM ν ν°μ κ°±μ νκΈ° μν FcmTokenUpdateService μΈν°νμ΄μ€λ₯Ό μΆκ°νμμ΅λλ€. - updateFcmToken(Long userId, String newToken) λ©μλλ‘ ν ν° κ°±μ μ± μ λΆμ¬
UserRepositoryλ₯Ό ν΅ν΄ μ¬μ©μλ₯Ό μ‘°νν ν, FcmTokenUpdateService μΈν°νμ΄μ€λ₯Ό ν΅ν΄ μ λ¬λ°μ μ ν ν°μ μ λ°μ΄νΈνλ λ‘μ§μ ꡬννμμ΅λλ€. - updateFcmToken λ©μλμμ μ‘΄μ¬νμ§ μλ μ¬μ©μ IDμΌ κ²½μ° μμΈ μ²λ¦¬ - νΈλμμ λ²μ λ΄μμ User μν°ν°μ FCM ν ν°μ κ°±μ
μλ‘μ΄ FCM ν ν°μ μ λ¬λ°μ μ μ κ°μ²΄μ λ°μν μ μλ updateFcmToken λ©μλλ₯Ό μΆκ°νμ΅λλ€. - FcmTokenUpdateServiceλ₯Ό νμ©ν΄ μ¬μ©μ FCM ν ν° κ°±μ - @transactionalμ μ μ©νμ¬ DB λ³κ²½ μ¬ν λ°μ
FCM ν ν°μ μλ‘ κ°±μ νμ λ λ°νν FCM_TOKEN_UPDATED μν μ½λλ₯Ό μΆκ°νμ΅λλ€. - 201 Created μνμ½λμ "FCM ν ν°μ΄ μ±κ³΅μ μΌλ‘ μ λ°μ΄νΈλμμ΅λλ€." λ©μμ§λ‘ ꡬμ±
isFcmTokenExpired λ©μλ λ΄ λΆνμν λ λ²μ return λ¬Έμ μ 리νκ³ , currentToken λ³μλ₯Ό μ¬μ©νλλ‘ μμ νμ΅λλ€. - μ€λ³΅λ return μ κ±° - μ½λ κ°λ μ±κ³Ό μ μ§λ³΄μμ± ν₯μ
κΈ°μ‘΄ ν ν° κ°μ²΄κ° μ κ°μΌλ‘ κ΅μ²΄λ μ μλλ‘ updateValue λ©μλλ₯Ό μΆκ°νμμ΅λλ€. - μλ‘μ΄ FcmToken μΈμ€ν΄μ€λ₯Ό μμ±ν΄ μν λ³κ²½ λ‘μ§μ μΊ‘μν - κ°μ²΄μ§ν₯μ μ± μ λΆλ¦¬λ₯Ό κ°ν
FCM ν ν°μ μλ‘ λ°κΈλ°μ μλ²μ μ λ¬νκΈ° μν μμ² DTOλ₯Ό μΆκ°νμ΅λλ€. - newToken νλ λ° μ μ ν©ν 리 λ©μλ of μ μ
FcmTokenUpdateServiceImplμ λν λ¨μ ν μ€νΈλ₯Ό μμ±νμμ΅λλ€. - μ ν¨ν μ¬μ©μ IDμ μλ‘μ΄ ν ν°μΌλ‘ μμ²ν λ μ μμ μΌλ‘ μ λ°μ΄νΈλλμ§ νμΈ - μ‘΄μ¬νμ§ μλ μ¬μ©μ IDμ λν΄ USER_NOT_FOUND μμΈ λ°μ κ²μ¦ - null ν ν°μ λν FCM_TOKEN_NOT_NULL μμΈ λ°μ κ²μ¦
- μ΄κΈ°ν μ±κ³΅/μ€ν¨ λ‘κ·Έ λ©μμ§λ₯Ό FcmLogMessages μμλ‘ λΆλ¦¬νμ¬ μ¬μ¬μ©μ±κ³Ό μΌκ΄μ± ν₯μ - μλΉμ€ ν€ λ¬Έμμ΄ μΈμ½λ©μ StandardCharsets.UTF_8μμ Encoding.UTF_8λ‘ ν΅μΌνμ¬ μ½λ μΌκ΄μ± μ μ§
- FcmConfig, FcmProperties ν΄λμ€λ₯Ό κΈ°μ‘΄ user.config ν¨ν€μ§μμ fcm.config ν¨ν€μ§λ‘ μ΄λνμ¬ κ΄μ¬μ¬ λΆλ¦¬ - @EnableConfigurationProperties(FcmProperties.class) μμΉλ₯Ό TerningApplicationμμ μ κ±°νκ³ FcmConfigλ‘ μ΄λνμ¬ ν μ€νΈ νκ²½μμμ λ‘λ© μ€λ₯ λ°©μ§ - μ ν리μΌμ΄μ μ΄κΈ°ν μ Firebase μ€μ μ΄ κ³΅ν΅ λͺ¨λλ‘ κ΄λ¦¬λλλ‘ κ΅¬μ‘° μ 리
[β¨ feat] FCM ν ν° μ¬λ°κΈ API ꡬν
- Message.of(template, params) ννλ‘ κ°μ νμ¬ μΈλΆμμ ν¬λ§·λ λ©μμ§λ₯Ό λκΈ°λ λ°©μ μ κ±° - λ©μΈ/μλΈ λ©μμ§μ ν¬λ§· μ± μμ Message λ΄λΆλ‘ μμνμ¬ μμ§λ ν₯μ - λ©μΈ λ©μμ§λ νμ₯μ± κ³ λ €ν΄ νλΌλ―Έν° κΈ°λ° ν¬λ§· κ΅¬μ‘°λ‘ ν΅μΌ
- Message.of(template, params) μ¬μ© λ°©μμ λ§κ² ν μ€νΈ μ½λ μ λ° μμ - λ©μΈ λ©μμ§λ νλΌλ―Έν° κΈ°λ° ν¬λ§· ꡬ쑰λ₯Ό μ¬μ©νλ―λ‘ null λμ VALID_PARAMS μ λ¬ - μ€ν¨ μΌμ΄μ€μμλ Message λ΄λΆ ν¬λ§· λ‘μ§μ ν μ€νΈνλλ‘ λ³κ²½
- `application.yml`, `application-dev.yml` νμΌμ `.gitignore`μ μΆκ°νμ¬ λ―Όκ°ν μ€μ μ λ³΄κ° Gitμ ν¬ν¨λμ§ μλλ‘ μ²λ¦¬νμμ΅λλ€. - QueryDSLμμ μμ±λλ Q ν΄λμ€ κ²½λ‘(`src/main/generated`)λ 무μ λμμ ν¬ν¨μμΌ λΉλ κ²°κ³Όλ¬Όμ΄ μΆμ λμ§ μλλ‘ μ€μ νμ΅λλ€.
- QueryDSL μ€μ μ μν μμ‘΄μ± λ° κ΄λ ¨ λλ ν 리(`src/main/generated/querydsl/`) μ€μ μ μΆκ°νμμ΅λλ€. - `compileOnly` μ€μ μ€λ³΅μ μ κ±°νκ³ `querydsl` μ€μ μ `compileClasspath`μ μ°κ²°νμμ΅λλ€. - WebFlux, Spring Batch μμ‘΄μ±μ νλ‘μ νΈμ μΆκ°νμ¬ κ΄λ ¨ κΈ°λ₯ κ°λ° μ€λΉλ₯Ό μλ£νμ΅λλ€. - PostgreSQL μμ‘΄μ± μ μΈ μ€ μ€λ³΅λ ꡬ문μ μ 리νμμ΅λλ€.
- QueryDSL μ¬μ©μ μν΄ `JPAQueryFactory`λ₯Ό λΉμΌλ‘ λ±λ‘νλ `QuerydslConfig` ν΄λμ€λ₯Ό μΆκ°νμμ΅λλ€. - `EntityManager`λ₯Ό μ£Όμ λ°μ `JPAQueryFactory`λ₯Ό μμ±νλ©°, μμ‘΄μ± μ£Όμ μ ν΅ν΄ QueryDSL 쿼리 κ°μ²΄λ₯Ό μ¬μ©ν μ μμ΅λλ€. - ν΄λΉ μ€μ μ ν΅ν΄ μλΉμ€ λ° λ¦¬ν¬μ§ν 리 λ¨μμ QueryDSLμ νΈλ¦¬νκ² νμ©ν μ μμ΅λλ€.
- μΈλΆ API νΈμΆμ μν `WebClient` μ€μ ν΄λμ€λ₯Ό μΆκ°νμμ΅λλ€. - `WebClient.Builder`λ₯Ό λΉμΌλ‘ μ£Όμ λ°μ κ³΅μ© `WebClient` μΈμ€ν΄μ€λ₯Ό μμ±ν©λλ€. - ν₯ν λΉλκΈ° HTTP μμ² μ²λ¦¬ μ μ¬μ¬μ© κ°λ₯ν ν΄λΌμ΄μΈνΈλ‘ νμ©ν μ μμ΅λλ€.
- μ΄μ μλ²μμ μ λ¬λ°μ μ€ν¬λ© μ μ μ 보λ₯Ό νννκΈ° μν `OpsScrapUserResponse` record ν΄λμ€λ₯Ό μΆκ°νμμ΅λλ€. - μ μ IDλ₯Ό λ¨μΌ κ°μΌλ‘ κ°μ§λ©°, μ μ ν©ν 리 λ©μλ `from`μ ν΅ν΄ λͺ μμ μΈ μμ± λ°©μμ μ 곡ν©λλ€. - ν₯ν μλ¦Ό μλ²μμ μ€ν¬λ© λκΈ°ν μμ² μ²λ¦¬ μ μ¬μ©λ©λλ€.
- μ΄μ μλ²λ‘λΆν° μμ ν λ€μμ μ€ν¬λ© μ μ IDλ₯Ό μλ΅ ννλ‘ κ°μΈλ `OpsScrapUsersResponse` record ν΄λμ€λ₯Ό μΆκ°νμμ΅λλ€. - μ μ ID 리μ€νΈλ₯Ό `OpsScrapUserResponse`λ‘ λ³ννλ μ μ ν©ν 리 λ©μλ `of`λ₯Ό μ 곡ν©λλ€. - μλ΅ κ΅¬μ‘°λ₯Ό λͺ νν λΆλ¦¬νμ¬ μΈλΆ API ν΅μ μ μΌκ΄λ ν¬λ§·μ μ μ§ν μ μλλ‘ νμμ΅λλ€.
- μ΄μ μλ²μ `/api/v1/external/scraps/unsynced` APIλ₯Ό νΈμΆνμ¬ λ―ΈλκΈ°νλ μ€ν¬λ© μ μ λͺ©λ‘μ κ°μ Έμ€λ ν΄λΌμ΄μΈνΈλ₯Ό ꡬννμμ΅λλ€. - WebClientλ₯Ό μ¬μ©νμ¬ λΉλκΈ° λ°©μμΌλ‘ νΈμΆνκ³ , μλ΅μ `OpsScrapUsersResponse`λ‘ νμ±λ©λλ€. - API URLμ `application.yml`μ μ€μ λ `internal.api.scrap.unsynced` κ°μ ν΅ν΄ μ£Όμ λ°μ΅λλ€. - ν₯ν λ°°μΉ μμ μμ μ΄μ μλ²μ λκΈ°νλ₯Ό μν ν΅μ¬ μμ‘΄ μ»΄ν¬λνΈλ‘ μ¬μ©λ©λλ€.
- `/api/v1/scraps/sync` POST APIλ₯Ό ν΅ν΄ μ΄μ μλ²μμ λ―ΈλκΈ°νλ μ€ν¬λ© μ μ μ 보λ₯Ό μ‘°ννκ³ μ μ₯νλ κΈ°λ₯μ ꡬννμμ΅λλ€. - λ΄λΆ λ‘μ§μ `ScrapService`μ `fetchAndSaveScrapUsersFromOps()` λ©μλλ₯Ό ν΅ν΄ μ²λ¦¬λ©λλ€. - μΈλΆ μμ€ν κ³Όμ μ€ν¬λ© λκΈ°νλ₯Ό μν μ§μ μ μν μ ν©λλ€.
- μ΄μ μλ²μμ μ λ¬λ°μ λ―ΈλκΈ°ν μ€ν¬λ© μ μ μ 보λ₯Ό μ²λ¦¬νκΈ° μν `ScrapService` ν΄λμ€λ₯Ό μΆκ°νμμ΅λλ€. - λ΄λΆμμλ `ScrapStatusSyncService`λ₯Ό ν΅ν΄ μ€μ λκΈ°ν λ‘μ§μ μμ μ²λ¦¬νλ©°, νΈλμμ μ μ μ©νμ¬ μΌκ΄μ±μ 보μ₯ν©λλ€. - 컨νΈλ‘€λ¬μ λλ©μΈ μλΉμ€ μ¬μ΄μ μ°κ²° μν μ μννλ κ³μΈ΅μ λλ€.
- μ΄μ μλ²λ‘λΆν° μ λ¬λ°μ μ€ν¬λ© μ μ μ 보λ₯Ό κΈ°λ°μΌλ‘ λκΈ°ν μμ μ μννκΈ° μν λλ©μΈ μλΉμ€ μΈν°νμ΄μ€λ₯Ό μ μνμμ΅λλ€. - ν₯ν ꡬν체μμ λκΈ°ν λΉμ¦λμ€ λ‘μ§μ λ΄λΉνκ² λλ©°, μλΉμ€ κ³μΈ΅(`ScrapService`)μμ ν΄λΉ μΈν°νμ΄μ€λ₯Ό ν΅ν΄ λ‘μ§μ μμν©λλ€. - μ μ°ν ꡬν체 κ΅μ²΄ λ° ν μ€νΈ μ©μ΄μ±μ κ³ λ €ν ꡬ쑰μ λλ€.
- `ScrapStatusSyncService` μΈν°νμ΄μ€μ ꡬνμ²΄λ‘ `ScrapStatusSyncServiceImpl`μ μΆκ°νμμ΅λλ€. - `OpsScrapUserClient`λ₯Ό ν΅ν΄ μ΄μ μλ²μμ λ―ΈλκΈ°νλ μ μ λͺ©λ‘μ μ‘°ννκ³ , μ μ ID 리μ€νΈλ₯Ό μΆμΆν©λλ€. - μ μ ID λͺ©λ‘μ΄ λΉμ΄μμ§ μμ κ²½μ° `ScrapSyncManager`λ₯Ό ν΅ν΄ λκΈ°ν μ²λ¦¬λ₯Ό μμν©λλ€. - μΈλΆ API μ°λλΆν° λκΈ°ν μ€νκΉμ§μ μ 체 νλ‘μΈμ€λ₯Ό λ΄λΉνλ ν΅μ¬ λ‘μ§μ λλ€.
- μ΄μ μλ²μμ μ λ¬λ°μ μ μ ID λͺ©λ‘μ κΈ°λ°μΌλ‘ μ€ν¬λ© λ°μ΄ν°λ₯Ό μμ±νκ±°λ μνλ₯Ό κ°±μ νλ `ScrapSyncManager`λ₯Ό ꡬννμμ΅λλ€. - μ μ μ 보μ κΈ°μ‘΄ μ€ν¬λ© λ°μ΄ν°λ₯Ό MapμΌλ‘ ꡬμ±νμ¬ ν¨μ¨μ μΈ μ‘°ν λ° λΉκ΅λ₯Ό μνν©λλ€. - `createOrUpdateScrap` λ©μλλ‘ μ μ λ³ μ²λ¦¬ λ‘μ§μ λΆλ¦¬νμ¬ κ°λ μ±κ³Ό μ± μ λΆλ¦¬λ₯Ό κ°ννμμ΅λλ€. - μ κ· μ μ μ λν΄μλ μ€ν¬λ©μ μμ±νκ³ , κΈ°μ‘΄ μ μ μ€ λ―Έμ€ν¬λ© μνμΈ κ²½μ°μλ§ μνλ₯Ό κ°±μ νλλ‘ μ²λ¦¬ν©λλ€.
- Spring Batchμ `ItemProcessor`λ₯Ό ꡬνν `ScrapUserItemProcessor` ν΄λμ€λ₯Ό μΆκ°νμμ΅λλ€. - μ΄μ μλ²λ‘λΆν° μ λ¬λ μ€ν¬λ© μ μ λ°μ΄ν°λ₯Ό λ‘κ·Έλ‘ νμΈνλ©°, κ°κ³΅ μμ΄ κ·Έλλ‘ λ€μ λ¨κ³λ‘ μ λ¬ν©λλ€. - μ μ ID λ‘κ·Έλ₯Ό ν΅ν΄ μ²λ¦¬ νλ¦ μΆμ μ΄ κ°λ₯νλλ‘ λλ²κΉ λ©μμ§λ₯Ό μΆκ°νμμ΅λλ€. - ν₯ν λ°μ΄ν° κ°κ³΅μ΄ νμν κ²½μ° νμ₯ κ°λ₯μ±μ μΌλμ λ ꡬ쑰μ λλ€.
- Spring Batchμ `ItemReader`λ₯Ό ꡬνν `ScrapUserItemReader` ν΄λμ€λ₯Ό μΆκ°νμμ΅λλ€. - `OpsScrapUserClient`λ₯Ό ν΅ν΄ μ΄μ μλ²μμ λ―ΈλκΈ°νλ μ€ν¬λ© μ μ λͺ©λ‘μ μ‘°νν©λλ€. - μ΅μ΄ read μ 리μ€νΈλ₯Ό μ‘°ννκ³ , μ΄νμλ λ°λ³΅μλ₯Ό ν΅ν΄ νλμ© μ²λ¦¬ λμ μ μ λ₯Ό λ°νν©λλ€. - λ‘κ·Έλ₯Ό ν΅ν΄ μ μ μ‘°ν μμ μμ μ λͺ νν κΈ°λ‘νλ©° λ°°μΉ νλ¦μ μΆμ ν μ μλλ‘ νμμ΅λλ€.
- λ§€μΌ 20μ 30λΆμ μ€ν¬λ© μ μ λκΈ°ν λ°°μΉλ₯Ό μ€ννλ `ScrapUserSyncJobScheduler`λ₯Ό ꡬννμμ΅λλ€. - `JobLauncher`λ₯Ό ν΅ν΄ `scrapSyncJob`μ μ€ννλ©°, λ§€ μ€νλ§λ€ κ³ μ ν `run.id` νλΌλ―Έν°λ₯Ό λΆμ¬ν©λλ€. - μ±κ³΅/μ€ν¨ μ¬λΆμ λ°λΌ λ‘κ·Έλ₯Ό μΆλ ₯νμ¬ λͺ¨λν°λ§μ΄ κ°λ₯νλλ‘ κ΅¬μ±νμμ΅λλ€. - λ°°μΉ μ€ν μ€μΌμ€μ cron ννμ `"0 30 20 * * *"`λ‘ μ€μ λμ΄ μμΌλ©°, μ΄μ νκ²½ κΈ°μ€μ λ°λΌ λ³κ²½ κ°λ₯ν©λλ€.
- Spring Batch κΈ°λ°μ μ€ν¬λ© μ μ λκΈ°ν λ°°μΉ μ‘μ ꡬμ±νμμ΅λλ€. - `scrapUserSyncJob`μ λ¨μΌ StepμΌλ‘ ꡬμ±λλ©°, Reader β Processor β Writer μμΌλ‘ μ μ λκΈ°νλ₯Ό μ²λ¦¬ν©λλ€. - chunk λ¨μλ 100μΌλ‘ μ€μ λμ΄ μμΌλ©°, μ₯μ 볡μλ ₯μ μν΄ μμΈ λ°μ μ μ΅λ 3νκΉμ§ μ¬μλνλλ‘ κ΅¬μ±νμμ΅λλ€. - Step μ΄λ¦μ μ€ν(`"s crapUserSyncStep"`)κ° μμ΄ `"scrapUserSyncStep"`μΌλ‘μ μμ μ΄ νμν©λλ€.
μλ¦Ό μ μ‘ μκ°μ νννλ κ° κ°μ²΄ ScheduledTimeμ ꡬννμ΅λλ€. - of(LocalDateTime) μ μ ν©ν 리 λ©μλ μ 곡 - isDue(now): μ§μ λ μκ°μ΄ νμ¬ μκ° μ΄μ μΈμ§ νλ¨ - JPA @embeddable λ° λΆλ³ κ°μ²΄ μ€κ³ μ μ©
μλ¦Όμ λ°μ‘ μνλ₯Ό λνλ΄λ κ° κ°μ²΄ SentStatusλ₯Ό ꡬννμ΅λλ€. - markNotSent(): μ΄κΈ° μν - markSent(): λ°μ‘ μλ£ μνλ‘ μ ν - isSent(), value(): λ°μ‘ μ¬λΆ νμΈ JPA @embeddable μ μ© λ° λΆλ³ κ°μ²΄ ν¨ν΄μ κΈ°λ°μΌλ‘ μ€κ³νμ΅λλ€.
μλ¦Ό μμ±μ μν μμ² λ°μ΄ν°λ₯Ό λ΄λ DTOμΈ NotificationCreateRequestλ₯Ό μ μνμ΅λλ€. - ν νλ¦Ώ νμ μ λ¬μ μν template νλ ν¬ν¨ - μ μ ν©ν 리 λ©μλ of(String) μ 곡
- CRON μ€μΌμ€, run.id ν€ κ°μ μμλ‘ μΆμΆνμ¬ μ¬μ¬μ©μ± ν₯μ - λΆνμν λ‘κ·Έ μμ μ κ±° λ° log λ©μμ§ ν΅μΌ - μμΈ λ°μ μ ScrapExceptionμ λμ§λλ‘ μ²λ¦¬ λ°©μ κ°μ
μ€ν¬λ© λκΈ°ν λ°°μΉ μ€ν μ€ μμΈ μν©μ μ²λ¦¬νκΈ° μν΄ SYNC_JOB_FAILED μλ¬ μ½λλ₯Ό μΆκ°νμ΅λλ€.
μ€ν¬λ©λ μ μ μ‘°ν κΈ°λ₯ κ°νλ₯Ό μν΄ ScrapRepositoryCustomμ μ¬μ©μ κΈ°λ° μ‘°ν λ©μλλ₯Ό μ μνμ΅λλ€. - findScrapsByUserIds(List<Long>) - findDistinctScrappedUsers()
μ€ν¬λ© μνκ° SCRAPPEDμΈ μ μ λ§ μ‘°ννλ findDistinctScrappedUsers λ©μλλ₯Ό ScrapRepositoryImplμ ꡬννμ΅λλ€. - distinct + fetchJoinμΌλ‘ μ€λ³΅ μ κ±° λ° μ±λ₯ μ΅μ ν
Notifications ν΄λμ€μ λΆλ³μ±μ 보μ₯νλ μΌκΈ 컬λ μ μ ꡬννμ΅λλ€. - `add()`, `remove()` λ©μλλ‘ μλ‘μ΄ μλ¦Ό μΆκ° λ° μ κ±° μ λΆλ³ 컬λ μ λ°ν - `values()` λ©μλλ‘ μλ¦Ό 리μ€νΈλ₯Ό λΆλ³ 리μ€νΈλ‘ λ°ν - `empty()` λ©μλλ₯Ό ν΅ν΄ λΉ μλ¦Ό λͺ©λ‘μ μμ±ν μ μλλ‘ ν¨
Scraps ν΄λμ€μ λΆλ³μ±μ 보μ₯νλ μΌκΈ 컬λ μ μ ꡬννμ΅λλ€. - `add()`, `remove()` λ©μλλ‘ μλ‘μ΄ μ€ν¬λ© μΆκ° λ° μ κ±° μ λΆλ³ 컬λ μ λ°ν - `values()` λ©μλλ‘ μ€ν¬λ© 리μ€νΈλ₯Ό λΆλ³ 리μ€νΈλ‘ λ°ν - `empty()` λ©μλλ₯Ό ν΅ν΄ λΉ μ€ν¬λ© λͺ©λ‘μ μμ±ν μ μλλ‘ ν¨
User μν°ν°μμ μ€λ³΅λ notificationsμ scraps νλλ₯Ό μ κ±°νκ³ , μΌκΈ 컬λ μ μ μ¬μ©νλλ‘ μμ νμ΅λλ€. - notifications νλ: List<Notifications> β List<Notification>μΌλ‘ λ³κ²½ - scraps νλ: List<Scrap> β μΌκΈ 컬λ μ μΈ Scrapsλ‘ λ³κ²½ - λΆνμν νλ μ€λ³΅μ ν΄κ²°νμ¬ κ°λ μ±κ³Ό μ½λ μμ μ± ν₯μ
- λ©μμ§ ν¬λ§·μμ {username}μ΄ ν¬ν¨λμ§ μλλ‘ κ²μ¦νλ ν
μ€νΈ μΆκ°
- λͺ¨λ μ μ μκ² 'μ΅κ·Ό μΈν΄μ μΆμ²' μλ¦Ό μμ± ν μ€νΈ ꡬν - μ€ν¬λ©ν μ μ μκ² 'κ΄μ¬ κ³΅κ³ μλ¦Ό' μμ± ν μ€νΈ ꡬν - μ€ν¬λ©νμ§ μμ μ μ μκ² μλ¦Όμ΄ μμ±λμ§ μλλ‘ κ²μ¦νλ ν μ€νΈ ꡬν - μ μ κ° μλ κ²½μ° μλ¦Όμ΄ μμ±λμ§ μμμ κ²μ¦νλ ν μ€νΈ ꡬν
- Notification μν°ν°μ μ μ₯, μ‘°ν, μμ κΈ°λ₯μ λͺ¨νΉνμ¬ ν μ€νΈνλ Repository ꡬν - JPAμ κΈ°λ³Έ λ©μλλ€μ λν ꡬν μΆκ° (save, findById, delete λ±) - ν μ€νΈ νκ²½μμ μ¬μ©ν μ μλ λ©λͺ¨λ¦¬ κΈ°λ° Repository ꡬν
- Scrap μν°ν°μ μ μ₯, μ‘°ν, μμ κΈ°λ₯μ λͺ¨νΉνμ¬ ν μ€νΈνλ Repository ꡬν - μ€ν¬λ© μνκ° 'SCRAPPED'μΈ μ μ λ₯Ό ꡬλ³νλ findDistinctScrappedUsers λ©μλ ꡬν - JPAμ κΈ°λ³Έ λ©μλλ€μ λͺ¨νΉνμ¬ ν μ€νΈ νκ²½μμ μ¬μ©ν μ μλλ‘ Repository ꡬν
[β»οΈ refactor] λ©μμ§ ν¬λ§· λ‘μ§μ λ΄λΆλ‘ μ΄λνμ¬ μμ± μ± μ λͺ νν λ° μμ§λ κ°μ
[β¨ feat] μ΄μμλ²μμ μ€ν¬λ© μ μ μ‘°ν ν μ μ₯νλ λκΈ°ν λ‘μ§ κ΅¬ν
[β¨ feat] λ©μμ§-μ μ μ‘°ν©μ ν΅ν΄ μλ¦Ό μμ± λ° μ μ₯ λ°°μΉ κ΅¬ν
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.
Pull Request Overview
This PR introduces a notification service implementation with scheduling support and updates several configuration components.
- Introduces a NotificationCreationExecutor interface and corresponding command/service implementations.
- Adds a REST controller to expose notification creation and integrates scheduling policies for notifications.
- Adds or updates configuration classes for Firebase (FCM), WebClient, Querydsl, and batch processing support.
Reviewed Changes
Copilot reviewed 79 out of 79 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/java/org/terning/notification/application/executor/NotificationCreationExecutor.java | New interface for executing notification creation. |
| src/main/java/org/terning/notification/application/command/NotificationCommandServiceImpl.java | Implementation of the notification command service. |
| src/main/java/org/terning/notification/application/command/NotificationCommandService.java | Notification command service interface definition. |
| src/main/java/org/terning/notification/application/NotificationService.java | Service layer combining command service and executor calls. |
| src/main/java/org/terning/notification/api/NotificationController.java | REST controller exposing the notification creation API endpoint. |
| src/main/java/org/terning/message/domain/vo/MessageWeeklyPolicy.java | Weekly scheduling policy encapsulation for messages. |
| src/main/java/org/terning/message/domain/enums/SendSchedulePolicy.java | Enum implementation for scheduling policies. |
| src/main/java/org/terning/message/domain/enums/MessageTemplateType.java | Enhanced message template type with scheduling and target type updates. |
| src/main/java/org/terning/message/domain/Message.java | Updated Message class adapting field names and factory method. |
| src/main/java/org/terning/infra/ops/scrap/dto/response/OpsScrapUsersResponse.java | Response record for unsynced scrap users. |
| src/main/java/org/terning/infra/ops/scrap/dto/response/OpsScrapUserResponse.java | Record for an individual scrap user response. |
| src/main/java/org/terning/infra/ops/scrap/OpsScrapUserClient.java | Client for fetching unsynced users using WebClient. |
| src/main/java/org/terning/global/config/WebClientConfig.java | WebClient bean configuration. |
| src/main/java/org/terning/global/config/QuerydslConfig.java | JPAQueryFactory bean configuration using Querydsl. |
| src/main/java/org/terning/fcm/config/FcmConfig.java | Firebase (FCM) configuration with custom properties and logging. |
| src/main/java/org/terning/TerningApplication.java | Main application class with added batch processing support. |
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.
π Work Description
π¬ To Reviewers
β PR check list