-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 푸시 알림 관련 enum 정의 * feat: 미션 인원 관련 enum 정의 * fix: 하루에 미션 인증 2번 방지 * feat: 푸시 알림 job 정의 * refactor: aop를 활용한 job 로깅 * refactor: 미션 인원 enum 활용하도록 수정 * feat: 미션 쿼리 추가 정의 * refactor: 함수 분리 * fix: 친구의 미션 참여 시 방장한테만 푸시 * refactor: 함수명 직관적으로 변경 * refactor: 비즈니스 로직 서비스 코드로 이동 * remove: 불필요한 구성 클래스 삭제 * refactor: 공통 로직 validator로 이동 * remove: 불필요한 코드 삭제 * refactor: 상수 사용하도록 수정 * comment: 메서드 설명 추가
- Loading branch information
Showing
16 changed files
with
341 additions
and
41 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
33 changes: 33 additions & 0 deletions
33
src/main/java/com/nexters/goalpanzi/common/aop/JobLoggingAspect.java
This file contains 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,33 @@ | ||
package com.nexters.goalpanzi.common.aop; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.apache.commons.lang3.time.StopWatch; | ||
import org.aspectj.lang.ProceedingJoinPoint; | ||
import org.aspectj.lang.annotation.Around; | ||
import org.aspectj.lang.annotation.Aspect; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Slf4j | ||
@Aspect | ||
@Component | ||
public class JobLoggingAspect { | ||
|
||
@Around("execution(* com.nexters.goalpanzi.schedule.*.executeInternal(..))") | ||
public void execute(final ProceedingJoinPoint joinPoint) throws Throwable { | ||
String jobName = joinPoint.getTarget().getClass().getSimpleName(); | ||
|
||
log.info("{} started.", jobName); | ||
|
||
StopWatch stopWatch = new StopWatch(); | ||
stopWatch.start(); | ||
|
||
try { | ||
joinPoint.proceed(); | ||
} catch (Exception e) { | ||
log.error("Error occurred while executing {}", jobName, e); | ||
} | ||
|
||
stopWatch.stop(); | ||
log.info("{} finished. Elapsed time: {} ms", jobName, 0); | ||
} | ||
} |
This file contains 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
16 changes: 16 additions & 0 deletions
16
src/main/java/com/nexters/goalpanzi/domain/firebase/PushTime.java
This file contains 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,16 @@ | ||
package com.nexters.goalpanzi.domain.firebase; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public enum PushTime { | ||
MORNING(9), | ||
AFTERNOON(15), | ||
EVERYDAY(15); | ||
|
||
private final int hour; | ||
|
||
PushTime(final int hour) { | ||
this.hour = hour; | ||
} | ||
} |
Oops, something went wrong.