优化资源列表视频资源的读取

This commit is contained in:
none
2023-03-09 10:21:26 +08:00
parent d269880986
commit f6be76b851
5 changed files with 16 additions and 14 deletions

View File

@@ -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);