/** 保存角色 */ public void saveRole() { TbRole model = new TbRole(); model.setRolename("ChuiZiHua"); model.setNote("remark"); roleService.save(model); log.info("model.getId:" + model.getId()); }
/** 分页 */ public void list() { TbRole entity = new TbRole(); Page<TbRole> pageInfo = new Page<TbRole>(); pageInfo.setStart(1); pageInfo.setPageSize(20); pageInfo.setPageNo(1); pageInfo.setOrderFiled("id"); pageInfo.setOrderDirection("desc"); Page<TbRole> page = roleService.findByPage(entity, pageInfo); log.info("page:" + Json.toJson(page)); }
/** 插入角色和权限的关系 */ public void updateRoleRight() { Long[] rightIds = {4L, 5L, 1L}; log.info("rightIds:" + Json.toJson(rightIds)); roleService.updateRoleRight(5L, rightIds); log.info("insert RoleRight success."); }