zhanghua
2023-12-12 bc2da7908a227c09e5cc7b6d8dab3e9c94b784a1
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
60
61
62
63
64
65
66
67
68
69
70
71
72
package com.ycl.controller.epuipment;
 
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ycl.annotation.LogSave;
import com.ycl.api.CommonResult;
import com.ycl.controller.BaseController;
import com.ycl.vo.equipment.HandheldTerminalVo;
import com.ycl.entity.equipment.HandheldTerminal;
import com.ycl.service.equipment.IHandheldTerminalService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
 
/**
 * 手持设备管理
 *
 * @version V1.0
 * @author: AI
 * @date: 2022-10-31 15:44
 **/
@RestController
@RequestMapping("/equipment_handheld_terminal")
@Api(tags = "手持设备管理")
public class HandheldTerminalController extends BaseController {
 
    IHandheldTerminalService handheldTerminalService;
 
    @Autowired
    public void setHandheldTerminalService(IHandheldTerminalService handheldTerminalService) {
        this.handheldTerminalService = handheldTerminalService;
    }
 
    @GetMapping("/query")
    @ApiOperation("查询")
    @LogSave(operationType = "手持设备管理", contain = "查询")
    public CommonResult<IPage<HandheldTerminalVo>> search(@RequestParam(required = true) Integer currentPage,
                                                          @RequestParam(required = true) Integer pageSize,
                                                          @RequestParam(required = false) Short state) {
        return CommonResult.success(handheldTerminalService.search(pageSize, currentPage, state));
    }
 
    @PostMapping("/add")
    @ApiOperation("添加")
    @LogSave(operationType = "手持设备管理", contain = "添加手持设备")
    public CommonResult add(@RequestBody HandheldTerminal handheldTerminal) {
        handheldTerminal.setState(Short.valueOf("1"));
        handheldTerminalService.save(handheldTerminal);
        return CommonResult.success(true);
    }
 
    @PutMapping("/update")
    @ApiOperation("修改")
    @LogSave(operationType = "手持设备管理", contain = "修改手持设备")
    public CommonResult update(@RequestBody HandheldTerminal handheldTerminal) {
 
        handheldTerminalService.updateById(handheldTerminal);
        return CommonResult.success(true);
    }
 
    @DeleteMapping("/delete/{id}")
    @ApiOperation("删除")
    @LogSave(operationType = "手持设备管理", contain = "删除手持设备")
    public CommonResult delete(@PathVariable Long id) {
 
        handheldTerminalService.removeById(id);
        return CommonResult.success(null);
    }
 
}