mitao
2025-04-04 d89a42213b4a32535e93185dedf41fe7a7fc1940
medicalWaste-admin/src/main/java/com/sinata/web/controller/backend/system/SysRoleController.java
@@ -23,6 +23,7 @@
import com.sinata.system.service.ISysRoleService;
import com.sinata.system.service.ISysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
@@ -35,13 +36,16 @@
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotBlank;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
 * 角色信息
@@ -117,8 +121,10 @@
    @ApiOperation("批量删除")
    @PostMapping("/deleteBatch")
    public R<?> deleteBatch(@ApiParam(name = "roleIds", value = "角色id列表", required = true) @NotEmpty(message = "角色id列表不能为空") @RequestBody List<Long> roleIds) {
        roleService.removeBatchByIds(roleIds);
    @ApiImplicitParam(name = "roleIdStr", value = "角色id字符串,多个用逗号分隔", required = true)
    public R<?> deleteBatch(@RequestParam @NotBlank(message = "角色id字符串不能为空") String roleIdStr) {
        List<Long> idList = Arrays.stream(roleIdStr.split(",")).map(Long::valueOf).collect(Collectors.toList());
        roleService.removeBatchByIds(idList);
        return R.ok();
    }
@@ -129,11 +135,22 @@
     */
    @ApiOperation("获取当前登录用户可管理角色列表")
    @GetMapping("/manageRoleList")
    public List<SysRoleVO> getManageRoleList() {
        return roleService.getManageRoleList(getLoginUser());
    public R<List<SysRoleVO>> getManageRoleList() {
        return R.ok(roleService.getManageRoleList(getLoginUser()));
    }
    /**
     * 角色列表
     *
     * @return
     */
    @ApiOperation("角色列表")
    @GetMapping("/list")
    public R<List<SysRoleVO>> queryList() {
        return R.ok(roleService.queryList());
    }
    @PreAuthorize("@ss.hasPermi('system:role:list')")
    @GetMapping("/list")
    //@GetMapping("/list")
    public TableDataInfo list(SysRole role)
    {
        startPage();