use of com.bc.pmpheep.back.po.WriterPermission in project pmph by BCSquad.
the class WriterUserController method resources.
/**
* <pre>
* 功能描述:根据用户 id 跳转到用户权限的列表页面
* 使用示范:
*
* @param userId
* @param model
* @return
* </pre>
*/
@ResponseBody
@LogDetail(businessType = BUSSINESS_TYPE, logRemark = "跳转到用户权限的列表页面")
@RequestMapping(value = "/resources/{id}", method = RequestMethod.GET)
public ResponseBean resources(@PathVariable("id") Long userId) {
Map<String, Object> result = new HashMap<String, Object>();
List<WriterPermission> resourceList = writerUserService.getListAllResource(userId);
WriterUser user = writerUserService.get(userId);
result.put("resources", resourceList);
result.put("user", user);
return new ResponseBean(result);
}
use of com.bc.pmpheep.back.po.WriterPermission in project pmph by BCSquad.
the class WriterPermissionServiceImpl method getListAllParentMenu.
@Override
public List<WriterPermission> getListAllParentMenu() {
List<WriterPermission> permissions = writerPermissionDao.getListAllParentMenu();
for (WriterPermission permission : permissions) {
List<WriterPermission> subList = this.getListChildMenuByParentId(permission.getId());
permission.setChildren(subList);
}
return permissions;
}
use of com.bc.pmpheep.back.po.WriterPermission in project pmph by BCSquad.
the class WriterPermissionServiceTest method addPmphPermissionTest.
/**
* PmphPermission 添加Test
*/
@Test
@Rollback(Const.ISROLLBACK)
public void addPmphPermissionTest() {
WriterPermission pp = new WriterPermission();
pp.setMenuName("用户管理1");
pp.setUrl("admin/user/add");
pp.setPermissionName("用户管理添加1");
pp.setPath("admin:add");
pp.setParentId(1L);
// 添加资源目录
Integer aInteger = writerPermissionService.addWriterPermission(pp);
Assert.assertTrue("是否添加成功", aInteger > 0 ? true : false);
}
Aggregations