赞
踩
示例1
- /**
- * 导出用户
- */
- @SneakyThrows
- @GetMapping("export-user")
- @ApiOperationSupport(order = 13)
- @ApiOperation(value = "导出用户", notes = "传入user")
- public void exportUser(@ApiIgnore @RequestParam Map<String, Object> user, BladeUser bladeUser, HttpServletResponse response) {
- QueryWrapper<User> queryWrapper = Condition.getQueryWrapper(user, User.class);
- if (!SecureUtil.isAdministrator()){
- queryWrapper.lambda().eq(User::getTenantId, bladeUser.getTenantId());
- }
- queryWrapper.lambda().eq(User::getIsDeleted, BladeConstant.DB_NOT_DELETED);
- List<UserExcel> list = userService.exportUser(queryWrapper);
- response.setContentType("application/vnd.ms-excel");
- response.setCharacterEncoding(Charsets.UTF_8.name());
- String fileName = URLEncoder.encode("用户数据导出", Charsets.UTF_8.name());
- response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
- EasyExcel.write(response.getOutputStream(), UserExcel.class).sheet("用户数据表").doWrite(list);
- }
示例2
- /**
- * 查询单条
- */
- @ApiOperationSupport(order =2)
- @ApiOperation(value = "查看详情", notes = "传入id")
- @GetMapping("/info")
- public R<UserVO> info(BladeUser user) {
- User detail = userService.getById(user.getUserId());
- return R.data(UserWrapper.build().entityVO(detail));
- }
示例3
- /**
- * 用户列表
- */
- @GetMapping("/list")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "account", value = "账号名", paramType = "query", dataType = "string"),
- @ApiImplicitParam(name = "realName", value = "姓名", paramType = "query", dataType = "string")
- })
- @ApiOperationSupport(order = 3)
- @ApiOperation(value = "列表", notes = "传入account和realName")
- public R<IPage<UserVO>> list(@ApiIgnore @RequestParam Map<String, Object> user, Query query, BladeUser bladeUser) {
- QueryWrapper<User> queryWrapper = Condition.getQueryWrapper(user, User.class);
- IPage<User> pages = userService.page(Condition.getPage(query), (!bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID)) ? queryWrapper.lambda().eq(User::getTenantId, bladeUser.getTenantId()) : queryWrapper);
- return R.data(UserWrapper.build().pageVO(pages));
- }
示例4
- /**
- * 新增或修改
- */
- @PostMapping("/submit")
- @ApiOperationSupport(order = 4)
- @ApiOperation(value = "新增或修改", notes = "传入User")
- public R submit(@Valid @RequestBody User user) {
- return R.status(userService.submit(user));
- }
示例5
- /**
- * 修改
- */
- @PostMapping("/update")
- @ApiOperationSupport(order = 5)
- @ApiOperation(value = "修改", notes = "传入User")
- public R update(@Valid @RequestBody User user) {
- return R.status(userService.updateById(user));
- }
示例6
- /**
- * 删除
- */
- @PostMapping("/remove")
- @ApiOperationSupport(order = 6)
- @ApiOperation(value = "删除", notes = "传入id集合")
- public R remove(@RequestParam String ids) {
- return R.status(userService.deleteLogic(Func.toLongList(ids)));
- }
示例7
- /**
- * 设置菜单权限
- *
- * @param userIds
- * @param roleIds
- * @return
- */
- @PostMapping("/grant")
- @ApiOperationSupport(order = 7)
- @ApiOperation(value = "权限设置", notes = "传入roleId集合以及menuId集合")
- public R grant(@ApiParam(value = "userId集合", required = true) @RequestParam String userIds,
- @ApiParam(value = "roleId集合", required = true) @RequestParam String roleIds) {
- boolean temp = userService.grant(userIds, roleIds);
- return R.status(temp);
- }
示例8
- @PostMapping("/reset-password")
- @ApiOperationSupport(order = 8)
- @ApiOperation(value = "初始化密码", notes = "传入userId集合")
- public R resetPassword(@ApiParam(value = "userId集合", required = true) @RequestParam String userIds) {
- boolean temp = userService.resetPassword(userIds);
- return R.status(temp);
- }
示例9
- /**
- * 修改密码
- *
- * @param oldPassword
- * @param newPassword
- * @param newPassword1
- * @return
- */
- @PostMapping("/update-password")
- @ApiOperationSupport(order = 9)
- @ApiOperation(value = "修改密码", notes = "传入密码")
- public R updatePassword(BladeUser user, @ApiParam(value = "旧密码", required = true) @RequestParam String oldPassword,
- @ApiParam(value = "新密码", required = true) @RequestParam String newPassword,
- @ApiParam(value = "新密码", required = true) @RequestParam String newPassword1) {
- boolean temp = userService.updatePassword(user.getUserId(), oldPassword, newPassword, newPassword1);
- return R.status(temp);
- }
示例10
- /**
- * 用户列表
- *
- * @param user
- * @return
- */
- @GetMapping("/user-list")
- @ApiOperationSupport(order = 10)
- @ApiOperation(value = "用户列表", notes = "传入user")
- public R<List<User>> userList(User user) {
- List<User> list = userService.list(Condition.getQueryWrapper(user));
- return R.data(list);
- }
示例11
- /**
- * 导出模板
- */
- @SneakyThrows
- @GetMapping("export-template")
- @ApiOperationSupport(order = 14)
- @ApiOperation(value = "导出模板")
- public void exportUser(HttpServletResponse response) {
- List<UserExcel> list = new ArrayList<>();
- response.setContentType("application/vnd.ms-excel");
- response.setCharacterEncoding(Charsets.UTF_8.name());
- String fileName = URLEncoder.encode("用户数据模板", Charsets.UTF_8.name());
- response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
- EasyExcel.write(response.getOutputStream(), UserExcel.class).sheet("用户数据表").doWrite(list);
- }
示例12
- /**
- * 分页
- */
- @GetMapping("/list")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "category", value = "公告类型", paramType = "query", dataType = "integer"),
- @ApiImplicitParam(name = "title", value = "公告标题", paramType = "query", dataType = "string")
- })
- @ApiOperationSupport(order = 2)
- @ApiOperation(value = "分页", notes = "传入notice")
- public R<IPage<NoticeVO>> list(@ApiIgnore @RequestParam Map<String, Object> notice, Query query) {
- IPage<Notice> pages = noticeService.page(Condition.getPage(query), Condition.getQueryWrapper(notice, Notice.class));
- return R.data(NoticeWrapper.build().pageVO(pages));
- }
示例13
- /**
- * 新增
- */
- @PostMapping("/save")
- @ApiOperationSupport(order = 3)
- @ApiOperation(value = "新增", notes = "传入notice")
- public R save(@RequestBody Notice notice) {
- return R.status(noticeService.save(notice));
- }
示例14
- /**
- * 修改
- */
- @PostMapping("/update")
- @ApiOperationSupport(order = 4)
- @ApiOperation(value = "修改", notes = "传入notice")
- public R update(@RequestBody Notice notice) {
- return R.status(noticeService.updateById(notice));
- }
示例15
- /**
- * 新增或修改
- */
- @PostMapping("/submit")
- @ApiOperationSupport(order = 5)
- @ApiOperation(value = "新增或修改", notes = "传入notice")
- public R submit(@RequestBody Notice notice) {
- return R.status(noticeService.saveOrUpdate(notice));
- }
示例16
- /**
- * 删除
- */
- @PostMapping("/remove")
- @ApiOperationSupport(order = 6)
- @ApiOperation(value = "逻辑删除", notes = "传入notice")
- public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
- boolean temp = noticeService.deleteLogic(Func.toLongList(ids));
- return R.status(temp);
- }
示例17
- /**
- * 新增或修改
- */
- @PostMapping("/submit")
- @ApiOperationSupport(order = 4)
- @ApiOperation(value = "新增或修改", notes = "传入dict")
- public R submit(@Valid @RequestBody Dict dict) {
- return R.status(dictService.submit(dict));
- }
示例18
- /**
- * 删除
- */
- @PostMapping("/remove")
- @CacheEvict(cacheNames = {DICT_LIST, DICT_VALUE}, allEntries = true)
- @ApiOperationSupport(order = 5)
- @ApiOperation(value = "删除", notes = "传入ids")
- public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
- return R.status(dictService.removeByIds(Func.toLongList(ids)));
- }
示例19
- /**
- * 获取字典
- *
- * @return
- */
- @GetMapping("/dictionary")
- @ApiOperationSupport(order = 6)
- @ApiOperation(value = "获取字典", notes = "获取字典")
- public R<List<Dict>> dictionary(String code) {
- List<Dict> tree = dictService.getList(code);
- return R.data(tree);
- }
示例20
- /**
- * 新增或修改
- */
- @PostMapping("/submit")
- @PreAuth(RoleConstant.HAS_ROLE_ADMIN)
- @ApiOperationSupport(order = 3)
- @ApiOperation(value = "新增或修改", notes = "传入menu")
- public R submit(@Valid @RequestBody Menu menu) {
- return R.status(menuService.saveOrUpdate(menu));
- }
示例21
- /**
- * 删除
- */
- @PostMapping("/remove")
- @PreAuth(RoleConstant.HAS_ROLE_ADMIN)
- @ApiOperationSupport(order = 4)
- @ApiOperation(value = "删除", notes = "传入ids")
- public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
- return R.status(menuService.removeByIds(Func.toLongList(ids)));
- }
示例22
- /**
- * 前端菜单数据
- */
- @GetMapping("/routes")
- @ApiOperationSupport(order = 5)
- @ApiOperation(value = "前端菜单数据", notes = "前端菜单数据")
- public R<List<MenuVO>> routes(BladeUser user) {
- List<MenuVO> list = menuService.routes(user.getRoleId());
- return R.data(list);
- }
示例23
- /**
- * 前端按钮数据
- */
- @GetMapping("/buttons")
- @ApiOperationSupport(order = 6)
- @ApiOperation(value = "前端按钮数据", notes = "前端按钮数据")
- public R<List<MenuVO>> buttons(BladeUser user) {
- List<MenuVO> list = menuService.buttons(user.getRoleId());
- return R.data(list);
- }
示例24
- /**
- * 获取权限分配树形结构
- */
- @GetMapping("/grant-tree")
- @ApiOperationSupport(order = 8)
- @ApiOperation(value = "权限分配树形结构", notes = "权限分配树形结构")
- public R<List<MenuVO>> grantTree(BladeUser user) {
- return R.data(menuService.grantTree(user));
- }
示例25
- /**
- * 获取权限分配树形结构
- */
- @GetMapping("/role-tree-keys")
- @ApiOperationSupport(order = 9)
- @ApiOperation(value = "角色所分配的树", notes = "角色所分配的树")
- public R<List<String>> roleTreeKeys(String roleIds) {
- return R.data(menuService.roleTreeKeys(roleIds));
- }
示例26
- /**
- * 获取配置的角色权限
- */
- @GetMapping("auth-routes")
- @ApiOperationSupport(order = 10)
- @ApiOperation(value = "菜单的角色权限")
- public R<List<Kv>> authRoutes(BladeUser user) {
- return R.data(menuService.authRoutes(user));
- }
示例27
- /**
- * 分页 岗位表
- */
- @GetMapping("/list")
- @ApiOperationSupport(order = 2)
- @ApiOperation(value = "分页", notes = "传入post")
- public R<IPage<PostVO>> list(Post post, Query query) {
- IPage<Post> pages = postService.page(Condition.getPage(query), Condition.getQueryWrapper(post));
- return R.data(PostWrapper.build().pageVO(pages));
- }
示例28
- /**
- * 自定义分页 岗位表
- */
- @GetMapping("/page")
- @ApiOperationSupport(order = 3)
- @ApiOperation(value = "分页", notes = "传入post")
- public R<IPage<PostVO>> page(PostVO post, Query query) {
- IPage<PostVO> pages = postService.selectPostPage(Condition.getPage(query), post);
- return R.data(pages);
- }
示例29
- /**
- * 新增 岗位表
- */
- @PostMapping("/save")
- @ApiOperationSupport(order = 4)
- @ApiOperation(value = "新增", notes = "传入post")
- public R save(@Valid @RequestBody Post post) {
- return R.status(postService.save(post));
- }
示例30
- /**
- * 修改 岗位表
- */
- @PostMapping("/update")
- @ApiOperationSupport(order = 5)
- @ApiOperation(value = "修改", notes = "传入post")
- public R update(@Valid @RequestBody Post post) {
- return R.status(postService.updateById(post));
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。