| | |
| | | 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; |
| | |
| | | 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()) { |
| | |
| | | } |
| | | |
| | | @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"); |
| | |
| | | } |
| | | |
| | | @PostMapping("/listSimpleRole") |
| | | @PreAuthorize("@ss.hasPermi('project:legacy:query')") |
| | | public AjaxResult listSimpleRole() { |
| | | return AjaxResult.success(rolesservice.listSimpleRole()); |
| | | } |