|
|
@ -13,10 +13,10 @@ import java.util.List;
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Repository
|
|
|
|
@Repository
|
|
|
|
public interface ChatSessionRepository extends CosmosRepository<ChatSession, String> {
|
|
|
|
public interface ChatSessionRepository extends CosmosRepository<ChatSession, String> {
|
|
|
|
@Query("select c.id, c.code, c.title, c.userId, c.createTime from c where c.code = 'ChatSession' and c.sessionId = @sessionId")
|
|
|
|
@Query("select c.id, c.code, c.title, c.userId, c.createTime from c where c.code = 'ChatSession' and c.id = @sessionId")
|
|
|
|
List<ChatSession> findBySessionId(String sessionId);
|
|
|
|
List<ChatSession> findBySessionId(String sessionId);
|
|
|
|
|
|
|
|
|
|
|
|
@Query("select c.id, c.code, c.title, c.userId, c.createTime from c where c.code = 'ChatSession' and c.userId = @userId")
|
|
|
|
@Query("select c.id, c.code, c.title, c.userId, c.createTime, c.updateTime from c where c.code = 'ChatSession' and c.userId = @userId")
|
|
|
|
List<ChatSession> findByUserId(String userId);
|
|
|
|
List<ChatSession> findByUserId(String userId);
|
|
|
|
|
|
|
|
|
|
|
|
@Query("SELECT value ARRAY_SLICE(c.history, -3) FROM c where c.id = @sessionId and c.code = 'ChatSession'")
|
|
|
|
@Query("SELECT value ARRAY_SLICE(c.history, -3) FROM c where c.id = @sessionId and c.code = 'ChatSession'")
|
|
|
|