zhangwencui
2 天以前 b30f4c40c77a940a2a749a676e901787f55040b0
src/main/java/com/ruoyi/projectManagement/controller/RolesController.java
@@ -14,6 +14,7 @@
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -28,12 +29,14 @@
    private RolesMapper rolesMapper;
    @GetMapping("/listPage")
    @PreAuthorize("@ss.hasPermi('project:legacy:query')")
    @Operation(summary = "分页查询所有")
    public AjaxResult listPage(Page<Roles> page, Roles roles) {
        return AjaxResult.success(rolesservice.listPage(page, roles));
    }
    @PostMapping("/add")
    @PreAuthorize("@ss.hasPermi('project:legacy:maintain')")
    @Operation(summary = "新增")
    public AjaxResult add(@RequestBody RoleDto roleDto) {
        if (roleDto.getIsDefaultNo()) {
@@ -43,12 +46,14 @@
    }
    @PostMapping("/update")
    @PreAuthorize("@ss.hasPermi('project:legacy:maintain')")
    @Operation(summary = "修改")
    public AjaxResult update(@RequestBody Roles roles) {
        return AjaxResult.success(rolesservice.updateById(roles));
    }
    @DeleteMapping("/delete")
    @PreAuthorize("@ss.hasPermi('project:legacy:maintain')")
    @Operation(summary = "删除")
    public AjaxResult delete(@RequestBody List<Long> ids) {
        if (CollectionUtils.isEmpty(ids)) return AjaxResult.error("请传入要删除的ID");
@@ -56,6 +61,7 @@
    }
    @PostMapping("/listSimpleRole")
    @PreAuthorize("@ss.hasPermi('project:legacy:query')")
    public AjaxResult listSimpleRole() {
        return AjaxResult.success(rolesservice.listSimpleRole());
    }