|
|
@ -76,7 +76,7 @@ public class ChatSessionServiceImpl implements ChatSessionService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
CosmosPatchOperations options = CosmosPatchOperations.create()
|
|
|
|
CosmosPatchOperations options = CosmosPatchOperations.create()
|
|
|
|
.replace("/title", title);
|
|
|
|
.replace("/title", title);
|
|
|
|
chatSessionRepository.save(id, PK.of(PK.CHAT_SESSION),ChatSession.class, options);
|
|
|
|
chatSessionRepository.save(id, PK.of(PK.CHAT_SESSION), ChatSession.class, options);
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -91,4 +91,15 @@ public class ChatSessionServiceImpl implements ChatSessionService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
chatSessionRepository.deleteById(id, PK.of(PK.CHAT_SESSION));
|
|
|
|
chatSessionRepository.deleteById(id, PK.of(PK.CHAT_SESSION));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public List<Message> listMyHistory(String sessionId) {
|
|
|
|
|
|
|
|
User user = SecurityUtil.getLoginUser();
|
|
|
|
|
|
|
|
String userId = user.getId();
|
|
|
|
|
|
|
|
ChatSession session = chatSessionRepository.findChatSessionByIdAndCode(sessionId, PK.CHAT_SESSION);
|
|
|
|
|
|
|
|
if (!userId.equals(session.getUserId())) {
|
|
|
|
|
|
|
|
throw new ServiceException(ErrorCode.NO_AUTH_ERROR);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return session.getHistory();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|