io.github.wslxm.springbootplus2.manage.sys.controller.SysRoleController Maven / Gradle / Ivy
The newest version!
package io.github.wslxm.springbootplus2.manage.sys.controller;
import io.github.wslxm.springbootplus2.core.base.model.BasePage;
import io.github.wslxm.springbootplus2.core.base.controller.BaseController;
import io.github.wslxm.springbootplus2.core.constant.BaseConstant;
import io.github.wslxm.springbootplus2.core.result.Result;
import io.github.wslxm.springbootplus2.manage.sys.model.dto.SysRoleDTO;
import io.github.wslxm.springbootplus2.manage.sys.model.query.SysRoleQuery;
import io.github.wslxm.springbootplus2.manage.sys.model.vo.SysRoleVO;
import io.github.wslxm.springbootplus2.manage.sys.service.SysRoleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
/**
*
* @author 王松
* @WX-QQ 1720696548
* @date 2019/11/13 13:38
*/
@RestController
@RequestMapping(BaseConstant.Uri.API_ADMIN+ "/sys/role")
@Api(value = "SysRoleController", tags = "base--sys--角色管理")
public class SysRoleController extends BaseController {
@GetMapping(value = "/findPage")
@ApiOperation(value = "列表查询")
public Result> findPage(@ModelAttribute SysRoleQuery query) {
return Result.success(baseService.findPage(query));
}
@PostMapping
@ApiOperation(value = "添加")
public Result insert(@RequestBody SysRoleDTO dto) {
return Result.successInsert(baseService.insert(dto));
}
@PutMapping(value = "/{id}")
@ApiOperation(value = "ID编辑")
public Result upd(@PathVariable String id, @RequestBody SysRoleDTO dto) {
return Result.successUpdate(baseService.upd(id, dto));
}
@DeleteMapping(value = "/{id}")
@ApiOperation(value = "ID删除")
public Result del(@PathVariable String id) {
return Result.successDelete(baseService.del(id));
}
//=========================================================================
//============================ 增删改查外 ===================================
//=========================================================================
//=========================================================================
// @PutMapping(value = "/updRoleAuth")
// @ApiOperation(value = "角色的URL权限分配")
// public Result updRoleAuth(@RequestBody RoleAuthDTO dto) {
// return Result.successUpdate(baseService.roleUrlAuth(dto));
// }
// @PutMapping(value = "/updRoleAuthAll")
// @ApiOperation(value = "所有角色拥有所有权限")
// public Result updRoleAuthAll() {
// return Result.successUpdate(baseService.roleAuthAll());
// }
}