mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-12-16 16:14:19 +08:00
优化资源列表视频资源的读取
This commit is contained in:
@@ -43,7 +43,7 @@ public class ResourceController {
|
||||
String sortAlgo = MapUtils.getString(params, "sort_algo");
|
||||
String name = MapUtils.getString(params, "name");
|
||||
String type = MapUtils.getString(params, "type");
|
||||
String categoryIdsStr = MapUtils.getString(params, "category_ids");
|
||||
String categoryIds = MapUtils.getString(params, "category_ids");
|
||||
|
||||
if (type == null || type.trim().length() == 0) {
|
||||
return JsonResponse.error("请选择资源类型");
|
||||
@@ -53,13 +53,10 @@ public class ResourceController {
|
||||
filter.setSortAlgo(sortAlgo);
|
||||
filter.setSortField(sortField);
|
||||
filter.setType(type);
|
||||
filter.setCategoryIds(categoryIds);
|
||||
if (name != null && name.length() > 0) {
|
||||
filter.setName(name);
|
||||
}
|
||||
if (categoryIdsStr != null && categoryIdsStr.length() != 0) {
|
||||
Integer[] categoryIds = Arrays.stream(categoryIdsStr.split(",")).map(Integer::valueOf).toArray(Integer[]::new);
|
||||
filter.setCategoryIds(categoryIds);
|
||||
}
|
||||
|
||||
PaginationResult<Resource> result = resourceService.paginate(page, size, filter);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user