Search in sources :

Example 6 with WriterPermission

use of com.bc.pmpheep.back.po.WriterPermission in project pmph by BCSquad.

the class WriterUserController method resources.

/**
 * <pre>
 * 功能描述:根据用户 id 跳转到用户权限的列表页面
 * 使用示范:
 *
 * &#64;param userId
 * &#64;param model
 * &#64;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);
}
Also used : WriterPermission(com.bc.pmpheep.back.po.WriterPermission) HashMap(java.util.HashMap) ResponseBean(com.bc.pmpheep.controller.bean.ResponseBean) WriterUser(com.bc.pmpheep.back.po.WriterUser) LogDetail(com.bc.pmpheep.annotation.LogDetail) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 7 with WriterPermission

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;
}
Also used : WriterPermission(com.bc.pmpheep.back.po.WriterPermission)

Example 8 with WriterPermission

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);
}
Also used : WriterPermission(com.bc.pmpheep.back.po.WriterPermission) Test(org.junit.Test) BaseTest(com.bc.pmpheep.test.BaseTest) Rollback(org.springframework.test.annotation.Rollback)

Aggregations

WriterPermission (com.bc.pmpheep.back.po.WriterPermission)8 BaseTest (com.bc.pmpheep.test.BaseTest)6 Test (org.junit.Test)6 Rollback (org.springframework.test.annotation.Rollback)6 WriterUser (com.bc.pmpheep.back.po.WriterUser)2 LogDetail (com.bc.pmpheep.annotation.LogDetail)1 WriterRole (com.bc.pmpheep.back.po.WriterRole)1 WriterRolePermission (com.bc.pmpheep.back.po.WriterRolePermission)1 ResponseBean (com.bc.pmpheep.controller.bean.ResponseBean)1 HashMap (java.util.HashMap)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1