mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-07-23 17:49:34 +08:00
补齐资源分类的权限
This commit is contained in:
parent
ef87c684c6
commit
3fa8a047d0
@ -174,6 +174,7 @@ public class ResourceCategoryController {
|
|||||||
return JsonResponse.success();
|
return JsonResponse.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BackendPermission(slug = BPermissionConstant.RESOURCE_CATEGORY)
|
||||||
@PutMapping("/update/sort")
|
@PutMapping("/update/sort")
|
||||||
@Log(title = "资源-分类-更新排序", businessType = BusinessTypeConstant.UPDATE)
|
@Log(title = "资源-分类-更新排序", businessType = BusinessTypeConstant.UPDATE)
|
||||||
public JsonResponse resort(@RequestBody @Validated ResourceCategorySortRequest req) {
|
public JsonResponse resort(@RequestBody @Validated ResourceCategorySortRequest req) {
|
||||||
@ -181,6 +182,7 @@ public class ResourceCategoryController {
|
|||||||
return JsonResponse.success();
|
return JsonResponse.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BackendPermission(slug = BPermissionConstant.RESOURCE_CATEGORY)
|
||||||
@PutMapping("/update/parent")
|
@PutMapping("/update/parent")
|
||||||
@Log(title = "资源-分类-更新父级", businessType = BusinessTypeConstant.UPDATE)
|
@Log(title = "资源-分类-更新父级", businessType = BusinessTypeConstant.UPDATE)
|
||||||
public JsonResponse updateParent(@RequestBody @Validated ResourceCategoryParentRequest req)
|
public JsonResponse updateParent(@RequestBody @Validated ResourceCategoryParentRequest req)
|
||||||
|
@ -71,7 +71,7 @@ public class ResourceController {
|
|||||||
String type = MapUtils.getString(params, "type");
|
String type = MapUtils.getString(params, "type");
|
||||||
String categoryIds = MapUtils.getString(params, "category_ids");
|
String categoryIds = MapUtils.getString(params, "category_ids");
|
||||||
|
|
||||||
if (type == null || type.trim().length() == 0) {
|
if (type == null || type.trim().isEmpty()) {
|
||||||
return JsonResponse.error("请选择资源类型");
|
return JsonResponse.error("请选择资源类型");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ public class ResourceController {
|
|||||||
|
|
||||||
// 操作人
|
// 操作人
|
||||||
data.put("admin_users", new HashMap<>());
|
data.put("admin_users", new HashMap<>());
|
||||||
if (result.getData().size() > 0) {
|
if (!result.getData().isEmpty()) {
|
||||||
Map<Integer, String> adminUsers =
|
Map<Integer, String> adminUsers =
|
||||||
adminUserService
|
adminUserService
|
||||||
.chunks(result.getData().stream().map(Resource::getAdminId).toList())
|
.chunks(result.getData().stream().map(Resource::getAdminId).toList())
|
||||||
@ -148,12 +148,12 @@ public class ResourceController {
|
|||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
@Log(title = "资源-批量列表", businessType = BusinessTypeConstant.DELETE)
|
@Log(title = "资源-批量列表", businessType = BusinessTypeConstant.DELETE)
|
||||||
public JsonResponse multiDestroy(@RequestBody ResourceDestroyMultiRequest req) {
|
public JsonResponse multiDestroy(@RequestBody ResourceDestroyMultiRequest req) {
|
||||||
if (req.getIds() == null || req.getIds().size() == 0) {
|
if (req.getIds() == null || req.getIds().isEmpty()) {
|
||||||
return JsonResponse.error("请选择需要删除的资源");
|
return JsonResponse.error("请选择需要删除的资源");
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Resource> resources = resourceService.chunks(req.getIds());
|
List<Resource> resources = resourceService.chunks(req.getIds());
|
||||||
if (resources == null || resources.size() == 0) {
|
if (resources == null || resources.isEmpty()) {
|
||||||
return JsonResponse.success();
|
return JsonResponse.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user