疯狂的狮子Li
2023-01-13 0fc796b90d3f44b81ef30285edb897223df439f7
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysPostController.java
@@ -11,14 +11,11 @@
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.SysPost;
import com.ruoyi.system.service.ISysPostService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletResponse;
import java.util.List;
/**
@@ -27,7 +24,6 @@
 * @author Lion Li
 */
@Validated
@Tag(name ="岗位信息控制器", description = "岗位信息管理")
@RequiredArgsConstructor
@RestController
@RequestMapping("/system/post")
@@ -38,14 +34,15 @@
    /**
     * 获取岗位列表
     */
    @Operation(summary = "获取岗位列表")
    @SaCheckPermission("system:post:list")
    @GetMapping("/list")
    public TableDataInfo<SysPost> list(SysPost post, PageQuery pageQuery) {
        return postService.selectPagePostList(post, pageQuery);
    }
    @Operation(summary = "导出岗位列表")
    /**
     * 导出岗位列表
     */
    @Log(title = "岗位管理", businessType = BusinessType.EXPORT)
    @SaCheckPermission("system:post:export")
    @PostMapping("/export")
@@ -56,18 +53,18 @@
    /**
     * 根据岗位编号获取详细信息
     *
     * @param postId 岗位ID
     */
    @Operation(summary = "根据岗位编号获取详细信息")
    @SaCheckPermission("system:post:query")
    @GetMapping(value = "/{postId}")
    public R<SysPost> getInfo(@Parameter(name = "岗位ID") @PathVariable Long postId) {
    public R<SysPost> getInfo(@PathVariable Long postId) {
        return R.ok(postService.selectPostById(postId));
    }
    /**
     * 新增岗位
     */
    @Operation(summary = "新增岗位")
    @SaCheckPermission("system:post:add")
    @Log(title = "岗位管理", businessType = BusinessType.INSERT)
    @PostMapping
@@ -83,7 +80,6 @@
    /**
     * 修改岗位
     */
    @Operation(summary = "修改岗位")
    @SaCheckPermission("system:post:edit")
    @Log(title = "岗位管理", businessType = BusinessType.UPDATE)
    @PutMapping
@@ -98,19 +94,19 @@
    /**
     * 删除岗位
     *
     * @param postIds 岗位ID串
     */
    @Operation(summary = "删除岗位")
    @SaCheckPermission("system:post:remove")
    @Log(title = "岗位管理", businessType = BusinessType.DELETE)
    @DeleteMapping("/{postIds}")
    public R<Void> remove(@Parameter(name = "岗位ID串") @PathVariable Long[] postIds) {
    public R<Void> remove(@PathVariable Long[] postIds) {
        return toAjax(postService.deletePostByIds(postIds));
    }
    /**
     * 获取岗位选择框列表
     */
    @Operation(summary = "获取岗位选择框列表")
    @GetMapping("/optionselect")
    public R<List<SysPost>> optionselect() {
        List<SysPost> posts = postService.selectPostAll();