whycrzg
2021-04-07 585ad3e3541a8e83db039df59e42ab640f66c221
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
package com.whyc.controller;
 
import com.whyc.dto.DeviceConditionDTO;
import com.whyc.dto.Response;
import com.whyc.pojo.DeviceResourceApply;
import com.whyc.service.DeviceResourceApplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
 
/**
 * 设备资源申请
 */
@RestController
@RequestMapping("deviceResourceApply")
@Api(tags = "设备资源")
public class DeviceResourceApplyController {
 
    @Autowired
    private DeviceResourceApplyService service;
 
    @PostMapping("all")
    @ApiOperation(value = "查询所有设备状态分页-筛选")
    public Response getAllDeviceStatus(@RequestParam Integer pageNum,@RequestParam Integer pageSize,
                                       @RequestBody DeviceConditionDTO deviceConditionDTO){
        return service.getAllDeviceStatus(pageNum,pageSize,deviceConditionDTO);
    }
 
    @GetMapping
    @ApiOperation(value = "查询设备状态-根据设备id")
    @ApiIgnore
    public Response getDeviceStatus(@RequestParam Integer deviceId){
        return null;
    }
 
    @PostMapping
    @ApiOperation(value = "提交申请")
    public Response apply(@RequestBody DeviceResourceApply resourceApply){
 
        return service.apply(resourceApply);
    }
 
    @PostMapping("applyPage")
    @ApiOperation(value = "查询申请列表分页-筛选")
    public Response getApplyPage(@RequestParam Integer pageNum,@RequestParam Integer pageSize,
                                 @RequestBody DeviceConditionDTO condition){
        return service.getApplyPage(pageNum,pageSize,condition);
    }
 
    @PutMapping("approve")
    @ApiOperation(value = "审核")
    public Response approve(@RequestParam Integer id,@RequestParam Integer status){
 
        return service.approve(id,status);
    }
 
    @GetMapping("applyInfo")
    @ApiOperation(value = "查询单个申请状态-根据申请id")
    public Response getApplyInfo(@RequestParam Integer id){
 
        return service.getApplyInfo(id);
    }
}