-
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 branch 'dev' into test/#89-daily-check
- Loading branch information
Showing
25 changed files
with
432 additions
and
61 deletions.
There are no files selected for viewing
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
15 changes: 15 additions & 0 deletions
15
be/src/main/java/yeonba/be/chatting/dto/request/ChatPublishRequest.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,15 @@ | ||
package yeonba.be.chatting.dto.request; | ||
|
||
import java.io.Serializable; | ||
import java.time.LocalDateTime; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class ChatPublishRequest implements Serializable { | ||
|
||
private long roomId; | ||
private long userId; | ||
private String userName; | ||
private String content; | ||
private LocalDateTime sentAt; | ||
} |
15 changes: 15 additions & 0 deletions
15
be/src/main/java/yeonba/be/chatting/dto/request/ChatSubscribeResponse.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,15 @@ | ||
package yeonba.be.chatting.dto.request; | ||
|
||
import java.io.Serializable; | ||
import java.time.LocalDateTime; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class ChatSubscribeResponse implements Serializable { | ||
|
||
private long roomId; | ||
private long userId; | ||
private String userName; | ||
private String content; | ||
private LocalDateTime sentAt; | ||
} |
17 changes: 0 additions & 17 deletions
17
be/src/main/java/yeonba/be/chatting/dto/request/ChattingSendMessageRequest.java
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
be/src/main/java/yeonba/be/chatting/dto/response/ChatMessageResponse.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,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; | ||
} |
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
4 changes: 4 additions & 0 deletions
4
be/src/main/java/yeonba/be/chatting/repository/chatmessage/ChatMessageRepository.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 |
---|---|---|
@@ -1,13 +1,17 @@ | ||
package yeonba.be.chatting.repository.chatmessage; | ||
|
||
import java.util.List; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
import yeonba.be.chatting.entity.ChatMessage; | ||
import yeonba.be.chatting.entity.ChatRoom; | ||
|
||
@Repository | ||
public interface ChatMessageRepository extends JpaRepository<ChatMessage, Long> { | ||
|
||
ChatMessage findFirstByChatRoomIdOrderBySentAtDesc(long chatRoomId); | ||
|
||
int countByChatRoomIdAndReadIsFalse(long chatRoomId); | ||
|
||
List<ChatMessage> findAllByChatRoomOrderBySentAtDesc(ChatRoom chatRoom); | ||
} |
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
19 changes: 19 additions & 0 deletions
19
be/src/main/java/yeonba/be/chatting/service/RedisChattingPublisher.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,19 @@ | ||
package yeonba.be.chatting.service; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.data.redis.core.RedisTemplate; | ||
import org.springframework.data.redis.listener.ChannelTopic; | ||
import org.springframework.stereotype.Service; | ||
import yeonba.be.chatting.dto.request.ChatPublishRequest; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class RedisChattingPublisher { | ||
|
||
private final RedisTemplate<String, Object> redisTemplate; | ||
|
||
public void publish(ChannelTopic topic, ChatPublishRequest request) { | ||
|
||
redisTemplate.convertAndSend(topic.getTopic(), request); | ||
} | ||
} |
Oops, something went wrong.