mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-04-24 16:34:20 +08:00
Compare commits
3 Commits
79ad3c3b17
...
4d8d801be2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4d8d801be2 | ||
|
|
b80db694c5 | ||
|
|
6f497b142e |
@@ -26,7 +26,6 @@ import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -110,6 +109,14 @@ public class MemoryServiceImpl implements MemoryService, CommandLineRunner {
|
||||
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ public abstract class BaseMapper implements SchemaMapper {
|
||||
Map<MatchText, List<T>> matchResult = matchStrategy.match(chatQueryContext, terms,
|
||||
chatQueryContext.getRequest().getDataSetIds());
|
||||
List<T> matches = new ArrayList<>();
|
||||
if (Objects.isNull(matchResult)) {
|
||||
if (Objects.isNull(matchResult) || matchResult.isEmpty()) {
|
||||
return matches;
|
||||
}
|
||||
Optional<List<T>> first = matchResult.entrySet().stream()
|
||||
|
||||
Reference in New Issue
Block a user