Skip to content

Commit

Permalink
fix: 오타 및 어노테이션 수정(#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
acceptor-gyu committed May 24, 2024
1 parent 373bea3 commit 7ee962f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
package yeonba.be.chatting.dto.response;

import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public class ChatMessageResponse {

private long userId;
private String userName;
private String content;
private LocalDateTime sentAt;

public ChatMessageResponse(long userId, String userName, String content, LocalDateTime sentAt) {

this.userId = userId;
this.userName = userName;
this.content = content;
this.sentAt = sentAt;
}
}
7 changes: 4 additions & 3 deletions be/src/main/java/yeonba/be/chatting/service/ChatService.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,12 @@ public class ChatService {
private final ChatMessageQuery chatMessageQuery;
private final UserQuery userQuery;
private final BlockQuery blockQuery;
private final NotificationQuery notificationQuey;
private final NotificationQuery notificationQuery;

private final ApplicationEventPublisher eventPublisher;
private final RedisChattingPublisher redisChattingPublisher;
private final RedisChattingSubscriber adapter;
private final RedisMessageListenerContainer container;
private final ChatRoomRepository chatRoomRepository;

@Transactional
public void publish(ChatPublishRequest request) {
Expand All @@ -67,6 +66,7 @@ public void publish(ChatPublishRequest request) {
new ChatMessage(chatRoom, sender, receiver, request.getContent(), request.getSentAt()));
}

@Transactional(readOnly = true)
public List<ChatMessageResponse> getChatMessages(long userId, long roomId) {

User user = userQuery.findById(userId);
Expand Down Expand Up @@ -135,9 +135,10 @@ public void requestChat(long senderId, long receiverId) {
eventPublisher.publishEvent(notificationSendEvent);
}

@Transactional
public void acceptRequestedChat(long userId, long notificationId) {

Notification notification = notificationQuey.findById(notificationId);
Notification notification = notificationQuery.findById(notificationId);

// 채팅 요청 알림인지 검증
if (!notification.getType().isChattingRequest()) {
Expand Down
2 changes: 1 addition & 1 deletion be/src/main/java/yeonba/be/config/RedisConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class RedisConfig {
private final ObjectMapper objectMapper;

/**
* redis pub/sub 메시지 처리 listender 설정
* redis pub/sub 메시지 처리 listener 설정
*/
@Bean
public RedisMessageListenerContainer redisMessageListenerContainer(
Expand Down
2 changes: 0 additions & 2 deletions be/src/main/java/yeonba/be/config/WebSocketConfig.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package yeonba.be.config;

import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
Expand All @@ -10,7 +9,6 @@

@Configuration
@EnableWebSocket
@RequiredArgsConstructor
@EnableWebSocketMessageBroker
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {

Expand Down

0 comments on commit 7ee962f

Please sign in to comment.