mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-06-10 20:04:06 +08:00
fixed: 资源列表的类型过滤
This commit is contained in:
parent
4a012afaea
commit
d269880986
@ -52,6 +52,7 @@ public class ResourceController {
|
||||
ResourcePaginateFilter filter = new ResourcePaginateFilter();
|
||||
filter.setSortAlgo(sortAlgo);
|
||||
filter.setSortField(sortField);
|
||||
filter.setType(type);
|
||||
if (name != null && name.length() > 0) {
|
||||
filter.setName(name);
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ import xyz.playedu.api.service.ResourceVideoService;
|
||||
import xyz.playedu.api.service.internal.ResourceCategoryRelationService;
|
||||
import xyz.playedu.api.types.paginate.PaginationResult;
|
||||
import xyz.playedu.api.types.paginate.ResourcePaginateFilter;
|
||||
import xyz.playedu.api.util.HelperUtil;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.ArrayList;
|
||||
@ -56,9 +57,7 @@ public class ResourceServiceImpl extends ServiceImpl<ResourceMapper, Resource> i
|
||||
if (filter.getCategoryIds() != null && filter.getCategoryIds().length > 0) {
|
||||
List<Integer> ridArray = relationService.getRidsByCids(Arrays.asList(filter.getCategoryIds()));
|
||||
if (ridArray == null || ridArray.size() == 0) {
|
||||
ridArray = new ArrayList<>() {{
|
||||
add(0);
|
||||
}};
|
||||
ridArray = HelperUtil.zeroIntegerList();
|
||||
}
|
||||
wrapper.in("id", ridArray);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user