-
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.
Merge pull request #291 from WE-ARE-RACCOONS/develop
Develop
- Loading branch information
Showing
15 changed files
with
237 additions
and
105 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
src/main/java/com/postgraduate/admin/application/usecase/AdminBatchUseCase.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,37 @@ | ||
package com.postgraduate.admin.application.usecase; | ||
|
||
import com.postgraduate.batch.scheduler.JobSchedulerConfig; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
@Slf4j | ||
@RequiredArgsConstructor | ||
public class AdminBatchUseCase { | ||
private final JobSchedulerConfig jobSchedulerConfig; | ||
|
||
public void startSalaryBatch() { | ||
try { | ||
jobSchedulerConfig.launchSalaryJob(); | ||
} catch (Exception e) { | ||
log.error("Create Salary Batch Exception : {}", e.getStackTrace()); | ||
} | ||
} | ||
|
||
public void startMentoringDoneBatch() { | ||
try { | ||
jobSchedulerConfig.launchDoneJob(); | ||
} catch (Exception e) { | ||
log.error("Create Salary Batch Exception : {}", e.getStackTrace()); | ||
} | ||
} | ||
|
||
public void startMentoringCancelBatch() { | ||
try { | ||
jobSchedulerConfig.launchCancelJob(); | ||
} catch (Exception e) { | ||
log.error("Create Salary Batch Exception : {}", e.getStackTrace()); | ||
} | ||
} | ||
} |
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
32 changes: 32 additions & 0 deletions
32
src/main/java/com/postgraduate/batch/cancel/CancelMentoringSkipListener.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,32 @@ | ||
package com.postgraduate.batch.cancel; | ||
|
||
import com.postgraduate.domain.mentoring.domain.entity.Mentoring; | ||
import com.postgraduate.global.slack.SlackErrorMessage; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.batch.core.SkipListener; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
@Slf4j | ||
public class CancelMentoringSkipListener implements SkipListener<Mentoring, CancelMentoring> { | ||
private final SlackErrorMessage slackErrorMessage; | ||
|
||
@Override | ||
public void onSkipInRead(Throwable t) { | ||
log.error("멘토링 자동 완료 ItemReader Skip message : {}", t.getMessage()); | ||
} | ||
|
||
@Override | ||
public void onSkipInProcess(Mentoring mentoring, Throwable t) { | ||
log.error("mentoringId : {} 자동 취소 실패, message : {}", mentoring.getMentoringId(), t.getMessage()); | ||
slackErrorMessage.sendSlackMentoringError(mentoring.getMentoringId(), t); | ||
} | ||
|
||
@Override | ||
public void onSkipInWrite(CancelMentoring cancelMentoring, Throwable t) { | ||
log.error("mentoringId : {} 자동 취소 실패, message : {}", cancelMentoring.mentoringId(), t.getMessage()); | ||
slackErrorMessage.sendSlackMentoringError(cancelMentoring.mentoringId(), t); | ||
} | ||
} |
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
18 changes: 18 additions & 0 deletions
18
src/main/java/com/postgraduate/batch/salary/CreateSalaryStepListener.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,18 @@ | ||
package com.postgraduate.batch.salary; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.batch.core.*; | ||
|
||
@Slf4j | ||
public class CreateSalaryStepListener implements StepExecutionListener { | ||
@Override | ||
public void beforeStep(StepExecution stepExecution) { | ||
log.info("createSalaryStep Start"); | ||
} | ||
|
||
@Override | ||
public ExitStatus afterStep(StepExecution stepExecution) { | ||
log.info("salary total read : {} and total write : {}", stepExecution.getReadCount(), stepExecution.getWriteCount()); | ||
return stepExecution.getExitStatus(); | ||
} | ||
} |
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
Oops, something went wrong.