-
Notifications
You must be signed in to change notification settings - Fork 0
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
[YS-130] feat: 기간이 지난 공고 state 변경 스케줄링 구현 #35
Conversation
- 필터링, offset-based 페이지네이션 위한 도메인 모델 정의: `CustomFilter` `Pagination` - querydsl 라이브러리 사용하여 동적 쿼리 작성, 다양한 필터 조건 처리 - entity.enum → entity.enums: 예약어 인식 이슈로 패키지 명 변경 - ExperimentPostMapper에서 입출력값 dto ↔ 유즈케이스 input/output으로 전환
- 실험공고 필터링 API 유즈케이스에 대한 유닛 테스트코드 작성
- 코드 리뷰 피드백 반영 - import` 문 활용 → 유즈케이스 내부 변환 로직의 경우 중복 네이밍 이슈로 필요 - 검증 로직 service로 책임 이전 → SRP 원칙 준수 - 필터링 중 `method` → `matchType` 으로 변수명 변경 - 유즈케이스 내부의 `@Schema` 어노테이션 제거
- '실험 방법' = '대면/비대면/전체'로 필터링하도록 수정 - '전체' 선택 시 쿼리에 미반영되도록 쿼리부분 수정
- 만료된 게시글의 상태를 1일 주기로 정기적 업데이트하기 위해 Quartz 스케줄러 구현 - `ExpiredExperimentPostJob` 에서 `ExperimentPostCustomRepository` 직접 호출→ `recruitDone` 상태 업데이트
- `ExpiredExperimentPostJob` 에서 `ExperimentPostService` 를 호출하여 로직 처리 - 재사용성, API 확장성과 비즈니스 로직 캡슐화를 위한 코드 리팩터링 - 로깅 추가: 스케줄링 작업 완료 시 recuritDone = true 된 ExperimentPost 수 기록
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.
고생하셨습니다! 구현하신 부분을 꼼꼼하게 확인했는데, 의존성 방향이 클린 아키텍처 원칙에 맞게 잘 설정된 것 같아 바로 approve합니다. 👍
코멘트를 남긴 부분만 다시 한 번 체크해주시면 감사하겠습니다~
@@ -48,6 +48,7 @@ dependencies { | |||
implementation("org.mariadb.jdbc:mariadb-java-client:2.7.3") | |||
implementation("org.springdoc:springdoc-openapi-starter-webmvc-ui:2.7.0") | |||
implementation("org.springframework.cloud:spring-cloud-starter-openfeign") | |||
implementation("org.springframework.boot:spring-boot-starter-quartz") |
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.
저도 기간이 지난 공고 state를 변경하는 작업
은 가볍다고 생각해서 quartz 구현 방식이 좋은 거 같아요 👍
|
||
|
||
|
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.
사소한 부분이지만 파일 끝에는 한 줄만 남겨주시면 감사합니다!
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.
좋은 피드백 감사합니다!!
.withIdentity("expired_experiment_post_trigger") | ||
.withSchedule( | ||
CronScheduleBuilder.dailyAtHourAndMinute(0, 0) |
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.
Quartz 스케줄러는 기본적으로 시스템의 기본 시간대를 따르는데 설정하지 않아도 한국 시간대에 동작할 수 있지만, 안정성과 명시성을 위해 명확히 타임존을 설정하는 것은 어떨까요??
.withIdentity("expired_experiment_post_trigger") | |
.withSchedule( | |
CronScheduleBuilder.dailyAtHourAndMinute(0, 0) | |
.withIdentity("expired_experiment_post_trigger") | |
.withSchedule( | |
CronScheduleBuilder.dailyAtHourAndMinute(0, 0) | |
.inTimeZone(TimeZone.getTimeZone("Asia/Seoul")) |
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.
저도 해당 부분을 저희 '대규모 설계 시스템 기초 스터디'에서 7주차(어제자 발표)로 공부한 TimeZone 이슈에서 명시할 필요성이 있다는 것을 느꼈습니다!
인사이트 있는 피드백 정말 감사합니다! 반영하겠습니다.
- 서버의 JVM 시간대와 Quartz 라이브러리의 시간대를 `Asia/Seoul` 로 명시화하였습니다.
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.
LGTM! 수정사항 잘 반영된 거 확인했습니다~ 수고하셨어요! 👏
|
* feat: implement experiment post lists filtering API with pagination - 필터링, offset-based 페이지네이션 위한 도메인 모델 정의: `CustomFilter` `Pagination` - querydsl 라이브러리 사용하여 동적 쿼리 작성, 다양한 필터 조건 처리 - entity.enum → entity.enums: 예약어 인식 이슈로 패키지 명 변경 - ExperimentPostMapper에서 입출력값 dto ↔ 유즈케이스 input/output으로 전환 * test: add test codes for experiment post filtering API usecase - 실험공고 필터링 API 유즈케이스에 대한 유닛 테스트코드 작성 * fix: add unreflected source files * fix: update '_ALL' option to return all posts on that region * fix: update code review's feedbacks - 코드 리뷰 피드백 반영 - import` 문 활용 → 유즈케이스 내부 변환 로직의 경우 중복 네이밍 이슈로 필요 - 검증 로직 service로 책임 이전 → SRP 원칙 준수 - 필터링 중 `method` → `matchType` 으로 변수명 변경 - 유즈케이스 내부의 `@Schema` 어노테이션 제거 * refact: delegate domain converter to ExperimentMapper * refact: rename usecase's class to suffix * refact: rename API endpoint query parameter → * test: update test codes for refactoring * refact: update misunderstood requirement to meet the busniess logic - '실험 방법' = '대면/비대면/전체'로 필터링하도록 수정 - '전체' 선택 시 쿼리에 미반영되도록 쿼리부분 수정 * fix: add ExperimentMapperTest codes to meet the test coverage * refact: refactor validator codes to upgrade readability * feat: add WebSecurityConfig codes to allow permit without authentication * fix: fix QueryDSL generation issues with entity and enum * test: add test codes to meet the test coverage guage * feat: implement experiment state scheudler using Quartz libraries - 만료된 게시글의 상태를 1일 주기로 정기적 업데이트하기 위해 Quartz 스케줄러 구현 - `ExpiredExperimentPostJob` 에서 `ExperimentPostCustomRepository` 직접 호출→ `recruitDone` 상태 업데이트 * feat: add scheduling jobs to application layer for clean architecture - `ExpiredExperimentPostJob` 에서 `ExperimentPostService` 를 호출하여 로직 처리 - 재사용성, API 확장성과 비즈니스 로직 캡슐화를 위한 코드 리팩터링 - 로깅 추가: 스케줄링 작업 완료 시 recuritDone = true 된 ExperimentPost 수 기록 * test: add test codes for experiment post status scheduler * refact: delete final lines to specify eof line * feat: specify Quartz time zone `Asia/Seoul` - 서버의 JVM 시간대와 Quartz 라이브러리의 시간대를 `Asia/Seoul` 로 명시화하였습니다. --------- Co-authored-by: jisu <[email protected]>
💡 작업 내용
experiment_post
에 대해, 매일 자정마다 자동으로recuritDone = false
를 설정해주는 스케줄러를 구현하였습니다.Asia/Seoul
로 설정됨을 확인했습니다😊✅ 셀프 체크리스트
🙋🏻 확인해주세요
🔗 Jira 티켓
https://yappsocks.atlassian.net/browse/YS-130
🔗 Jira 티켓
https://yappsocks.atlassian.net/browse/YS-130