mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-04-29 20:44:25 +08:00
Compare commits
1 Commits
4d8d801be2
...
79ad3c3b17
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79ad3c3b17 |
@@ -26,6 +26,7 @@ import org.springframework.boot.CommandLineRunner;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@@ -109,14 +110,6 @@ public class MemoryServiceImpl implements MemoryService, CommandLineRunner {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void batchDelete(List<Long> ids) {
|
public void batchDelete(List<Long> ids) {
|
||||||
QueryWrapper<ChatMemoryDO> queryWrapper = new QueryWrapper<>();
|
|
||||||
queryWrapper.lambda().in(ChatMemoryDO::getId, ids);
|
|
||||||
List<ChatMemoryDO> chatMemoryDOS = chatMemoryRepository.getMemories(queryWrapper);
|
|
||||||
chatMemoryDOS.forEach(chatMemoryDO -> {
|
|
||||||
if (MemoryStatus.ENABLED.toString().equals(chatMemoryDO.getStatus().trim())) {
|
|
||||||
disableMemory(chatMemoryDO);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
chatMemoryRepository.batchDelete(ids);
|
chatMemoryRepository.batchDelete(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ public abstract class BaseMapper implements SchemaMapper {
|
|||||||
Map<MatchText, List<T>> matchResult = matchStrategy.match(chatQueryContext, terms,
|
Map<MatchText, List<T>> matchResult = matchStrategy.match(chatQueryContext, terms,
|
||||||
chatQueryContext.getRequest().getDataSetIds());
|
chatQueryContext.getRequest().getDataSetIds());
|
||||||
List<T> matches = new ArrayList<>();
|
List<T> matches = new ArrayList<>();
|
||||||
if (Objects.isNull(matchResult) || matchResult.isEmpty()) {
|
if (Objects.isNull(matchResult)) {
|
||||||
return matches;
|
return matches;
|
||||||
}
|
}
|
||||||
Optional<List<T>> first = matchResult.entrySet().stream()
|
Optional<List<T>> first = matchResult.entrySet().stream()
|
||||||
|
|||||||
Reference in New Issue
Block a user