Skip to content

Commit

Permalink
#255 [CHORE] 변수 타입 lombok.val 사용 통일
Browse files Browse the repository at this point in the history
  • Loading branch information
yeseul106 committed Jul 1, 2024
1 parent 9c9966e commit c0ce999
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import jakarta.annotation.PostConstruct;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import lombok.RequiredArgsConstructor;
import lombok.val;
Expand Down Expand Up @@ -32,7 +31,7 @@ public class EventBridgeSenderImpl implements EventBridgeSender {

@PostConstruct
private void init() {
AwsBasicCredentials awsCredentials = AwsBasicCredentials.create(valueConfig.getAccessKey(),
val awsCredentials = AwsBasicCredentials.create(valueConfig.getAccessKey(),
valueConfig.getSecretKey());
this.schedulerClient = SchedulerClient.builder()
.region(Region.AP_NORTHEAST_2)
Expand All @@ -58,10 +57,10 @@ public void scheduleAlarm(EventBridgeSenderRequest request, String postDate, Str

private String formatCronExpression(String postDate, String postTime) {
try {
DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
LocalDateTime localDateTime = LocalDateTime.parse(postDate + " " + postTime, dateFormatter);
val dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
val localDateTime = LocalDateTime.parse(postDate + " " + postTime, dateFormatter);

ZonedDateTime utcDateTime = localDateTime.atZone(ZoneId.systemDefault())
val utcDateTime = localDateTime.atZone(ZoneId.systemDefault())
.withZoneSameInstant(ZoneId.of("UTC"));

return String.format("cron(%d %d %d %d ? %d)",
Expand All @@ -76,7 +75,7 @@ private String formatCronExpression(String postDate, String postTime) {
}

private String createScheduleName(String postDate, String postTime, Long alarmId) {
String formattedTime = postTime.replace(":", "-");
val formattedTime = postTime.replace(":", "-");
return String.format("%s_%s_%d", postDate, formattedTime, alarmId);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.sopt.makers.operation.client.alarm.eventBridgeServer.dto;

import java.util.List;
import lombok.val;
import org.sopt.makers.operation.alarm.domain.Category;

public record EventBridgeSenderRequest(
Expand All @@ -18,8 +19,8 @@ public static EventBridgeSenderRequest of(
String xApiKey, String service, String action,
List<String> userIds, String title, String content, Category category, String deepLink, String webLink
) {
EventBridgeSenderRequestHeader header = EventBridgeSenderRequestHeader.of(xApiKey, action, service);
EventBridgeSenderRequestBody body = EventBridgeSenderRequestBody.of(userIds, title, content, category, deepLink,
val header = EventBridgeSenderRequestHeader.of(xApiKey, action, service);
val body = EventBridgeSenderRequestBody.of(userIds, title, content, category, deepLink,
webLink);
return new EventBridgeSenderRequest(header, body);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.sopt.makers.operation.client.alarm.eventBridgeServer.dto;

import java.util.UUID;
import lombok.val;

public record EventBridgeSenderRequestHeader(
String action,
Expand All @@ -9,7 +10,7 @@ public record EventBridgeSenderRequestHeader(
String service
) {
public static EventBridgeSenderRequestHeader of(String xApiKey, String action, String service) {
String transactionId = UUID.randomUUID().toString();
val transactionId = UUID.randomUUID().toString();
return new EventBridgeSenderRequestHeader(action, xApiKey, transactionId, service);
}
}

0 comments on commit c0ce999

Please sign in to comment.