资源删除、编辑不需要权限

This commit is contained in:
none
2023-06-13 10:46:23 +08:00
parent 12056f648f
commit 3ec3e7e3e5
6 changed files with 121 additions and 35 deletions

View File

@@ -55,4 +55,6 @@ public interface ResourceService extends IService<Resource> {
Integer duration(Integer id);
void updateNameAndCategoryId(Integer id, String name, Integer categoryId);
List<Integer> categoryIds(Integer resourceId);
}

View File

@@ -172,4 +172,13 @@ public class ResourceServiceImpl extends ServiceImpl<ResourceMapper, Resource>
}
});
}
@Override
public List<Integer> categoryIds(Integer resourceId) {
return relationService
.list(relationService.query().getWrapper().eq("rid", resourceId))
.stream()
.map(ResourceCategoryRelation::getCid)
.toList();
}
}