-
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
Showing
43 changed files
with
274 additions
and
160 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
29 changes: 29 additions & 0 deletions
29
src/main/java/org/devcourse/resumeme/business/event/service/EventScheduler.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,29 @@ | ||
package org.devcourse.resumeme.business.event.service; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.devcourse.resumeme.business.event.domain.EventStatus; | ||
import org.devcourse.resumeme.business.event.repository.EventRepository; | ||
import org.springframework.scheduling.annotation.Scheduled; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Slf4j | ||
@Service | ||
@Transactional | ||
@RequiredArgsConstructor | ||
public class EventScheduler { | ||
|
||
private final EventRepository eventRepository; | ||
|
||
@Scheduled(cron = "0 0/1 * * * *") | ||
public void openBookedEvents() { | ||
log.info("scheduler 실행 됨"); | ||
eventRepository.openBookedEvent(EventStatus.OPEN, LocalDateTime.now()); | ||
eventRepository.closeApplyToEvent(EventStatus.CLOSE, LocalDateTime.now()); | ||
eventRepository.finishEvent(EventStatus.FINISH, LocalDateTime.now()); | ||
} | ||
|
||
} |
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
4 changes: 2 additions & 2 deletions
4
...event/service/EventCreationPublisher.java → ...vice/listener/EventCreationPublisher.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
5 changes: 0 additions & 5 deletions
5
src/main/java/org/devcourse/resumeme/business/event/service/vo/AllEventFilter.java
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
src/main/java/org/devcourse/resumeme/business/event/service/vo/AuthorizationRole.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,17 @@ | ||
package org.devcourse.resumeme.business.event.service.vo; | ||
|
||
import org.devcourse.resumeme.business.user.domain.Role; | ||
|
||
public enum AuthorizationRole { | ||
MENTOR, | ||
MENTEE, | ||
ALL; | ||
|
||
public static AuthorizationRole of(Role role) { | ||
return switch (role) { | ||
case ROLE_MENTEE -> MENTEE; | ||
case ROLE_PENDING, ROLE_MENTOR -> MENTOR; | ||
case ROLE_ADMIN -> ALL; | ||
}; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/org/devcourse/resumeme/business/event/service/vo/EventsFoundCondition.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,5 @@ | ||
package org.devcourse.resumeme.business.event.service.vo; | ||
|
||
public record EventsFoundCondition(Long userId, AuthorizationRole role) { | ||
|
||
} |
7 changes: 4 additions & 3 deletions
7
src/main/java/org/devcourse/resumeme/business/mail/service/EmailInfoGenerator.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
Oops, something went wrong.