mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-04-27 19:04:25 +08:00
Compare commits
3 Commits
8eb753052b
...
296c90ca56
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
296c90ca56 | ||
|
|
6f497b142e | ||
|
|
f489ea2f59 |
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -416,11 +416,10 @@ const ChatItem: React.FC<Props> = ({
|
||||
|
||||
const onExportData = () => {
|
||||
const { queryColumns, queryResults } = data || {};
|
||||
if (!!queryResults) {
|
||||
if (!!queryResults && !!queryColumns) {
|
||||
const exportData = queryResults.map(item => {
|
||||
return Object.keys(item).reduce((result, key) => {
|
||||
const columnName = queryColumns?.find(column => column.nameEn === key)?.name || key;
|
||||
result[columnName] = item[key];
|
||||
return queryColumns.reduce((result, column) => {
|
||||
result[column.name || column.nameEn] = item[column.nameEn];
|
||||
return result;
|
||||
}, {});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user