补齐资源分类的权限

This commit is contained in:
xxx 2023-09-20 16:56:47 +08:00
parent ef87c684c6
commit 3fa8a047d0
2 changed files with 6 additions and 4 deletions

View File

@ -174,6 +174,7 @@ public class ResourceCategoryController {
return JsonResponse.success();
}
@BackendPermission(slug = BPermissionConstant.RESOURCE_CATEGORY)
@PutMapping("/update/sort")
@Log(title = "资源-分类-更新排序", businessType = BusinessTypeConstant.UPDATE)
public JsonResponse resort(@RequestBody @Validated ResourceCategorySortRequest req) {
@ -181,6 +182,7 @@ public class ResourceCategoryController {
return JsonResponse.success();
}
@BackendPermission(slug = BPermissionConstant.RESOURCE_CATEGORY)
@PutMapping("/update/parent")
@Log(title = "资源-分类-更新父级", businessType = BusinessTypeConstant.UPDATE)
public JsonResponse updateParent(@RequestBody @Validated ResourceCategoryParentRequest req)

View File

@ -71,7 +71,7 @@ public class ResourceController {
String type = MapUtils.getString(params, "type");
String categoryIds = MapUtils.getString(params, "category_ids");
if (type == null || type.trim().length() == 0) {
if (type == null || type.trim().isEmpty()) {
return JsonResponse.error("请选择资源类型");
}
@ -103,7 +103,7 @@ public class ResourceController {
// 操作人
data.put("admin_users", new HashMap<>());
if (result.getData().size() > 0) {
if (!result.getData().isEmpty()) {
Map<Integer, String> adminUsers =
adminUserService
.chunks(result.getData().stream().map(Resource::getAdminId).toList())
@ -148,12 +148,12 @@ public class ResourceController {
@SneakyThrows
@Log(title = "资源-批量列表", businessType = BusinessTypeConstant.DELETE)
public JsonResponse multiDestroy(@RequestBody ResourceDestroyMultiRequest req) {
if (req.getIds() == null || req.getIds().size() == 0) {
if (req.getIds() == null || req.getIds().isEmpty()) {
return JsonResponse.error("请选择需要删除的资源");
}
List<Resource> resources = resourceService.chunks(req.getIds());
if (resources == null || resources.size() == 0) {
if (resources == null || resources.isEmpty()) {
return JsonResponse.success();
}