Skip to content

Commit

Permalink
optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
HamaWhiteGG committed Jul 21, 2023
1 parent 5956141 commit 791b52c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
*/
public class JsonUtils {

private JsonUtils() {
}

private static final ObjectMapper OBJECT_MAPPER = createObjectMapper();

private static ObjectMapper createObjectMapper() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,25 @@
public interface ChatMessageRepository {

/**
* load all history chat message of given sessionId
* Loads all historical chat messages for the given sessionId.
*
* @param sessionId
* @return
* @param sessionId The unique identifier of the chat session.
* @return A List of BaseMessage containing the chat message history for the session.
*/
List<BaseMessage> loadMessage(String sessionId);

/**
* Saves a chat message to the specified sessionId.
*
* @param sessionId The unique identifier of the chat session.
* @param baseMessage The BaseMessage to be saved.
*/
void saveMessage(String sessionId, BaseMessage baseMessage);

/**
* Clears all chat messages for the specified sessionId.
*
* @param sessionId The unique identifier of the chat session.
*/
void clearSessionChatMessage(String sessionId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public RedisChatMessageRepository(RedissonClient redissonClient, int ttlSeconds)
/**
* Construct the record key to use
*
* @return
* @return key
*/
private String key(String sessionId) {
if (this.keyPrefix == null) {
Expand Down
1 change: 0 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@
<version>${netty-resolver.version}</version>
</dependency>


</dependencies>
</dependencyManagement>

Expand Down

0 comments on commit 791b52c

Please sign in to comment.