-
Notifications
You must be signed in to change notification settings - Fork 0
[UPLUS-121] HOTFIX: Trigger job명 수정 #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -10,6 +10,7 @@ | |||||||||||||
|
|
||||||||||||||
| import com.project.core.controller.dto.request.BatchTriggerRequest; | ||||||||||||||
| import com.project.core.controller.dto.request.UpdateBatchScheduleRequest; | ||||||||||||||
| import com.project.core.infra.entity.batch.BatchJobType; | ||||||||||||||
| import com.project.global.config.CloudFunctionProperties; | ||||||||||||||
| import com.project.global.exception.code.domain.core.CoreErrorCode; | ||||||||||||||
| import com.project.global.exception.core.OperationFailedException; | ||||||||||||||
|
|
@@ -27,13 +28,14 @@ public class BatchTriggerClient { | |||||||||||||
|
|
||||||||||||||
| public void trigger(String job, String invMonth) { | ||||||||||||||
|
|
||||||||||||||
| String title = BatchJobType.getTitleByJobName(job); | ||||||||||||||
| String url = properties.getBaseUrl() + "/run-now"; | ||||||||||||||
| log.info("[BatchTrigger] calling url={}", url); | ||||||||||||||
|
|
||||||||||||||
| HttpHeaders headers = new HttpHeaders(); | ||||||||||||||
| headers.setContentType(MediaType.APPLICATION_JSON); | ||||||||||||||
|
|
||||||||||||||
| BatchTriggerRequest body = new BatchTriggerRequest(job, invMonth); | ||||||||||||||
| BatchTriggerRequest body = new BatchTriggerRequest(title, invMonth); | ||||||||||||||
|
|
||||||||||||||
| HttpEntity<BatchTriggerRequest> request = new HttpEntity<>(body, headers); | ||||||||||||||
|
|
||||||||||||||
|
|
@@ -49,12 +51,13 @@ public void trigger(String job, String invMonth) { | |||||||||||||
|
|
||||||||||||||
| public void schedule(String job, String cron) { | ||||||||||||||
|
|
||||||||||||||
| String title = BatchJobType.getTitleByJobName(job); | ||||||||||||||
|
Comment on lines
52
to
+54
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기에서도 private String getJobTitle(String jobName) {
return BatchJobType.getTitleByJobName(jobName);
}
Suggested change
|
||||||||||||||
| String url = properties.getBaseUrl() + "/schedule"; | ||||||||||||||
|
|
||||||||||||||
| HttpHeaders headers = new HttpHeaders(); | ||||||||||||||
| headers.setContentType(MediaType.APPLICATION_JSON); | ||||||||||||||
|
|
||||||||||||||
| UpdateBatchScheduleRequest body = new UpdateBatchScheduleRequest(job, cron); | ||||||||||||||
| UpdateBatchScheduleRequest body = new UpdateBatchScheduleRequest(title, cron); | ||||||||||||||
|
|
||||||||||||||
| HttpEntity<UpdateBatchScheduleRequest> request = new HttpEntity<>(body, headers); | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
잡 이름 변환 로직이 추가되면서
job파라미터는 이제jobName을 나타냅니다. 명확성을 위해 파라미터 이름을jobName으로 변경하는 것을 고려해 보세요. 이렇게 하면 코드의 가독성이 향상됩니다.