File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
src/main/java/com/moing/backend/domain/mission/application/service Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .moing .backend .domain .mission .application .service ;
2
+
3
+ import lombok .RequiredArgsConstructor ;
4
+ import lombok .extern .slf4j .Slf4j ;
5
+ import org .springframework .context .annotation .Profile ;
6
+ import org .springframework .scheduling .annotation .EnableAsync ;
7
+ import org .springframework .scheduling .annotation .EnableScheduling ;
8
+ import org .springframework .scheduling .annotation .Scheduled ;
9
+ import org .springframework .stereotype .Service ;
10
+ import org .springframework .transaction .annotation .Transactional ;
11
+
12
+
13
+ @ Slf4j
14
+ @ Service
15
+ @ Transactional
16
+ @ EnableAsync
17
+ @ EnableScheduling
18
+ @ RequiredArgsConstructor
19
+ @ Profile ("prod" )
20
+ public class MissionScheduleUseCase {
21
+
22
+ private final MissionRemindAlarmUseCase missionRemindAlarmUseCase ;
23
+ private final MissionUpdateUseCase missionUpdateUseCase ;
24
+
25
+ /**
26
+ * 단일 미션 마감
27
+ * 해당 시간 미션 마감
28
+ * 한시간 마다 실행
29
+ */
30
+ @ Scheduled (cron = "0 1 * * * *" )
31
+ public void singleMissionEndRoutine () {
32
+ missionUpdateUseCase .terminateMissionByAdmin ();
33
+ }
34
+
35
+ /**
36
+ * 리마인드 알림
37
+ * 인증하지 않은 미션이 있는 경우 알림
38
+ * 매일 오후 8시
39
+ */
40
+ @ Scheduled (cron = "0 0 20 * * *" )
41
+ public void MissionRemindAlarm () {
42
+ missionRemindAlarmUseCase .sendRemindMissionAlarm ();
43
+ }
44
+ }
You can’t perform that action at this time.
0 commit comments