mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 02:46:56 +00:00
fixed bug 2281 (#2309)
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@@ -50,10 +51,8 @@ public class DataSetController {
|
||||
|
||||
@GetMapping("/getDataSetList")
|
||||
public List<DataSetResp> getDataSetList(@RequestParam("domainId") Long domainId) {
|
||||
MetaFilter metaFilter = new MetaFilter();
|
||||
metaFilter.setDomainId(domainId);
|
||||
metaFilter.setStatus(StatusEnum.ONLINE.getCode());
|
||||
return dataSetService.getDataSetList(metaFilter);
|
||||
List<Integer> statuCodeList = Arrays.asList(StatusEnum.ONLINE.getCode(),StatusEnum.OFFLINE.getCode());
|
||||
return dataSetService.getDataSetList(domainId,statuCodeList);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
|
||||
@@ -20,6 +20,8 @@ public interface DataSetService {
|
||||
|
||||
List<DataSetResp> getDataSetList(MetaFilter metaFilter);
|
||||
|
||||
List<DataSetResp> getDataSetList(Long domainId ,List<Integer> statuCodesList);
|
||||
|
||||
void delete(Long id, User user);
|
||||
|
||||
Map<Long, List<Long>> getModelIdToDataSetIds(List<Long> dataSetIds, User user);
|
||||
|
||||
@@ -102,6 +102,20 @@ public class DataSetServiceImpl extends ServiceImpl<DataSetDOMapper, DataSetDO>
|
||||
return list(wrapper).stream().map(this::convert).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DataSetResp> getDataSetList(Long domainId, List<Integer> statuCodesList) {
|
||||
if(domainId==null || CollectionUtils.isEmpty(statuCodesList)){
|
||||
return List.of();
|
||||
}
|
||||
QueryWrapper<DataSetDO> wrapper = new QueryWrapper<>();
|
||||
wrapper.lambda().eq(DataSetDO::getDomainId, domainId);
|
||||
wrapper.lambda().in(DataSetDO::getStatus, statuCodesList);
|
||||
wrapper.lambda().ne(DataSetDO::getStatus, StatusEnum.DELETED.getCode());
|
||||
|
||||
return list(wrapper).stream().map(this::convert).collect(Collectors.toList());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(Long id, User user) {
|
||||
DataSetDO dataSetDO = getById(id);
|
||||
|
||||
Reference in New Issue
Block a user