页面权限接口

This commit is contained in:
张松 2025-04-02 15:21:10 +08:00
parent 0d11678148
commit 7d9cfb74f4
2 changed files with 15 additions and 1 deletions

View File

@ -50,6 +50,20 @@ public class ShopPagePermissionController {
return CzgResult.success(shopStaffPagePermissionService.add(StpKit.USER.getShopId(), pagePathPermissionAddDTO)); return CzgResult.success(shopStaffPagePermissionService.add(StpKit.USER.getShopId(), pagePathPermissionAddDTO));
} }
/**
* 获取员工拥有页面路径
* @param staffId 员工ID
*/
@GetMapping("/detail")
public CzgResult<List<ShopPagePath>> detail(@RequestParam Long staffId) {
Set<Long> pageIdList = shopStaffPagePermissionService.list(new QueryWrapper().eq(ShopStaffPagePermission::getShopId,
StpKit.USER.getShopId()).eq(ShopStaffPagePermission::getStaffId, staffId)).stream().map(ShopStaffPagePermission::getPagePathId).collect(Collectors.toSet());
if (pageIdList.isEmpty()) {
return CzgResult.success(new ArrayList<>());
}
return CzgResult.success(shopPagePathService.list(new QueryWrapper().in(ShopPagePath::getId, pageIdList)));
}
/** /**
* 获取当前员工已拥有页面路径权限 * 获取当前员工已拥有页面路径权限
*/ */