-
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.
- Loading branch information
1 parent
782e08d
commit 2bd25ce
Showing
16 changed files
with
114 additions
and
51 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
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
2 changes: 1 addition & 1 deletion
2
...y/server/api/utils/AlarmHistoryUtils.java → ...domain/common/util/AlarmHistoryUtils.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
2 changes: 1 addition & 1 deletion
2
.../alarm/model/dto/AnswerKnockEventDto.java → ...omains/alarm/dto/AnswerKnockEventDto.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package tify.server.api.alarm.model.dto; | ||
package tify.server.domain.domains.alarm.dto; | ||
|
||
|
||
import lombok.Builder; | ||
|
2 changes: 1 addition & 1 deletion
2
.../alarm/model/dto/CreateKnockEventDto.java → ...omains/alarm/dto/CreateKnockEventDto.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package tify.server.api.alarm.model.dto; | ||
package tify.server.domain.domains.alarm.dto; | ||
|
||
|
||
import lombok.Builder; | ||
|
2 changes: 1 addition & 1 deletion
2
...model/dto/ReceiveApplicationEventDto.java → ...alarm/dto/ReceiveApplicationEventDto.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package tify.server.api.alarm.model.dto; | ||
package tify.server.domain.domains.alarm.dto; | ||
|
||
|
||
import lombok.Builder; | ||
|
2 changes: 1 addition & 1 deletion
2
...rm/model/dto/SendApplicationEventDto.java → ...ns/alarm/dto/SendApplicationEventDto.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package tify.server.api.alarm.model.dto; | ||
package tify.server.domain.domains.alarm.dto; | ||
|
||
|
||
import lombok.Builder; | ||
|
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
55 changes: 55 additions & 0 deletions
55
Domain/src/main/java/tify/server/domain/scheduler/alarm/AlarmScheduler.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,55 @@ | ||
package tify.server.domain.scheduler.alarm; | ||
|
||
|
||
import java.time.LocalDate; | ||
import java.util.List; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.scheduling.annotation.Scheduled; | ||
import org.springframework.stereotype.Component; | ||
import org.springframework.transaction.annotation.Transactional; | ||
import tify.server.domain.domains.alarm.service.AlarmHistoryDomainService; | ||
import tify.server.domain.domains.question.adaptor.DailyQuestionAdaptor; | ||
import tify.server.domain.domains.question.domain.DailyQuestion; | ||
import tify.server.domain.domains.user.adaptor.UserAdaptor; | ||
import tify.server.domain.domains.user.domain.User; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
public class AlarmScheduler { | ||
|
||
private final UserAdaptor userAdaptor; | ||
private final DailyQuestionAdaptor dailyQuestionAdaptor; | ||
private final AlarmHistoryDomainService alarmHistoryDomainService; | ||
|
||
@Transactional | ||
@Scheduled(cron = "0 0 17 * * SUN", zone = "Asia/Seoul") | ||
public void executeToNotAnsweredQuestionAlarm() { | ||
LocalDate today = LocalDate.now(); | ||
DailyQuestion dailyQuestion = dailyQuestionAdaptor.queryByLoadingDate(today); | ||
alarmHistoryDomainService.executeToNotAnsweredQuestionAlarm(dailyQuestion.getId()); | ||
} | ||
|
||
@Transactional | ||
@Scheduled(cron = "0 0 21 * *", zone = "Asia/Seoul") | ||
public void executeToFriendBirthDayAlarm() { | ||
LocalDate fourDaysLater = LocalDate.now().plusDays(4); | ||
String monthAndYear = | ||
String.format( | ||
"%02d%02d", | ||
fourDaysLater.getMonth().getValue(), fourDaysLater.getDayOfMonth()); | ||
List<User> expectedBirthdayUserList = userAdaptor.queryExpectedBirthdayUsers(monthAndYear); | ||
alarmHistoryDomainService.executeToFriendBirthDayAlarm(expectedBirthdayUserList); | ||
} | ||
|
||
@Transactional | ||
@Scheduled(cron = "0 0 10 * *", zone = "Asia/Seoul") | ||
public void executeToBirthDayAlarm() { | ||
alarmHistoryDomainService.executeToBirthDayAlarm(); | ||
} | ||
|
||
@Transactional | ||
@Scheduled(cron = "0 0 18 7 *", zone = "Asia/Seoul") | ||
public void executeToFavorAlarm() { | ||
alarmHistoryDomainService.executeToFavorAlarm(); | ||
} | ||
} |