mitao
2025-02-26 b37f92c1f5bea036b13af38d82a0fa9ca690eb3b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package com.panzhihua.sangeshenbian.api;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.panzhihua.common.interfaces.OperLog;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.sangeshenbian.model.entity.SystemPost;
import com.panzhihua.sangeshenbian.service.ISystemPostService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
 
/**
 * @author zhibing.pu
 * @Date 2025/2/25 19:44
 */
@Api
@RestController
@RequestMapping("/systemPost")
public class SystemPostController {
    
    @Resource
    private ISystemPostService systemPostService;
    
    
    @PostMapping("/add")
    @ApiOperation(value = "添加职位", tags = {"三个身边后台-职位管理"})
    @OperLog(operModul = "三个身边后台",operType = 1,businessType = "添加职位")
    public R add(@RequestBody SystemPost systemPost) {
        systemPostService.save(systemPost);
        return R.ok();
    }
    
    
    @PostMapping("/edit")
    @ApiOperation(value = "编辑职位", tags = {"三个身边后台-职位管理"})
    @OperLog(operModul = "三个身边后台",operType = 2,businessType = "编辑职位")
    public R edit(@RequestBody SystemPost systemPost) {
        systemPostService.updateById(systemPost);
        return R.ok();
    }
    
    @DeleteMapping("/delete/{id}")
    @ApiOperation(value = "删除职位", tags = {"三个身边后台-职位管理"})
    @OperLog(operModul = "三个身边后台",operType = 3,businessType = "删除职位")
    public R delete(@PathVariable("id") Integer id) {
        systemPostService.removeById(id);
        return R.ok();
    }
    
    
    @GetMapping("/list")
    @ApiOperation(value = "获取列表数据", tags = {"三个身边后台-职位管理"})
    @OperLog(operModul = "三个身边后台",operType = 0,businessType = "获取职位列表数据")
    public R<IPage<SystemPost>> list(String name, Integer pageNum, Integer pageSize) {
        return R.ok(systemPostService.list(name, pageNum, pageSize));
    }
}