Skip to content

Commit b1d988b

Browse files
committed
refactor: 코드 스타일 정리
- 깃 잠재적인 이슈 예방 마지막 줄 개행 - 소나 이슈 수정.
1 parent 4b31ba5 commit b1d988b

21 files changed

+26
-32
lines changed

src/main/java/com/somemore/global/common/event/ServerEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ protected ServerEvent(
2828
this.subType = subType;
2929
this.createdAt = (createdAt == null) ? LocalDateTime.now() : createdAt;
3030
}
31-
}
31+
}

src/main/java/com/somemore/global/common/event/ServerEventPublisher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
public interface ServerEventPublisher {
44

5-
void publish(ServerEvent event);
5+
<T extends Enum<T>> void publish(ServerEvent<T> event);
66
}

src/main/java/com/somemore/global/common/event/ServerEventType.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
import lombok.RequiredArgsConstructor;
66

77
import java.util.Arrays;
8-
import java.util.Set;
98

109
@RequiredArgsConstructor
1110
@Getter
1211
public enum ServerEventType {
13-
NOTIFICATION(NotificationSubType.class)
14-
;
12+
NOTIFICATION(NotificationSubType.class);
1513

1614
private final Class<? extends Enum<?>> subtype;
1715

@@ -21,8 +19,4 @@ public static ServerEventType from(String value) {
2119
.findFirst()
2220
.orElseThrow(() -> new IllegalArgumentException("잘못된 이벤트 타입입니다: " + value));
2321
}
24-
25-
public Set<? extends Enum<?>> getSubtypes() {
26-
return Set.of(subtype.getEnumConstants());
27-
}
28-
}
22+
}

src/main/java/com/somemore/global/redis/config/CustomJacksonRedisSerializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ public T deserialize(byte[] bytes) throws SerializationException {
3939
throw new SerializationException("Could not deserialize bytes", e);
4040
}
4141
}
42-
}
42+
}

src/main/java/com/somemore/global/redis/publisher/RedisServerEventPublisher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class RedisServerEventPublisher implements ServerEventPublisher {
1919
private final RedisTemplate<String, Object> redisTemplate;
2020
private final Map<ServerEventType, ChannelTopic> eventTopics;
2121

22-
public void publish(ServerEvent event) {
22+
public <T extends Enum<T>> void publish(ServerEvent<T> event) {
2323
ServerEventType type = event.getType();
2424
ChannelTopic topic = eventTopics.get(type);
2525

@@ -30,4 +30,4 @@ public void publish(ServerEvent event) {
3030

3131
redisTemplate.convertAndSend(topic.getTopic(), event);
3232
}
33-
}
33+
}

src/main/java/com/somemore/global/redis/registrar/RedisListenerRegistrar.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ private void registerNotificationListener() {
2626
container.addMessageListener(redisNotificationSubscriber, notificationTopic);
2727
log.info("Redis 알림 리스너가 '{}' 토픽에 성공적으로 등록되었습니다.", notificationTopic.getTopic());
2828
}
29-
}
29+
}

src/main/java/com/somemore/notification/converter/MessageConverter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class MessageConverter {
1717

1818
private final ObjectMapper objectMapper;
1919

20-
public Notification ToNotification(String message) {
20+
public Notification from(String message) {
2121
try {
2222
JsonNode rootNode = objectMapper.readTree(message);
2323
String eventType = rootNode.get("subType").asText();
@@ -61,4 +61,4 @@ private String buildNotificationTitle(ApplyStatus newStatus) {
6161
default -> "봉사 활동 신청 상태가 변경되었습니다.";
6262
};
6363
}
64-
}
64+
}

src/main/java/com/somemore/notification/domain/Notification.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@ public Notification(
5959
this.relatedId = relatedId;
6060
this.read = false;
6161
}
62-
}
62+
}

src/main/java/com/somemore/notification/domain/NotificationSubType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ public static NotificationSubType from(String value) {
1919
.findFirst()
2020
.orElseThrow(() -> new IllegalArgumentException("잘못된 알림 타입입니다: " + value));
2121
}
22-
}
22+
}

src/main/java/com/somemore/notification/dto/NotificationResponseDto.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ public static NotificationResponseDto from(Notification notification) {
3131
notification.getCreatedAt()
3232
);
3333
}
34-
}
34+
}

0 commit comments

Comments
 (0)