whycxzp
2025-03-30 87ce3b2705c814523a199572c77402b96801e794
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package com.whyc.controller;
 
import com.github.pagehelper.PageInfo;
import com.whyc.dto.EnvironmentThreshold;
import com.whyc.dto.InspectionRecord;
import com.whyc.dto.Response;
import com.whyc.service.FireRobotService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
@RestController
@Api(tags = "消防机器人接口")
@RequestMapping("fireRobot")
public class InterfaceFireRobotController {
 
    @Autowired
    private FireRobotService service;
 
    /**
     * opendoor 打开卷帘门、closedoor 关闭卷帘门;openfire 打开七氟丙烷灭火器、closefire 关闭七氟丙烷灭火器;
     * API:http://192.168.10.45:8085/ControlInterfaceHandler?command=opendoor
     * @return
     */
    @PostMapping("control")
    public Response control(@RequestParam String command){
 
        return service.control(command);
    }
 
    /**
     * 指定任务点巡检接口示例
     * API:http://192.168.10.45:8085/SpecifyTask?interval=0-1&progress=88&direction=0
     * 请求参数    参数1    interval(string):巡检房间区间    是    ON
     *     参数2    progress(int):巡检位置百分比    是
     *     参数3    direction(int):巡检方向    是
     *     参数示例
     *
     * ["interval 格式示例:0-1 ; progress 必须是 0-100 的整数; direction 必须是 0 或 1]
     */
    @PostMapping("specifyTask")
    public Response specifyTask(@RequestParam String interval,@RequestParam Integer progress,@RequestParam Integer direction){
 
        return service.specifyTask(interval,progress,direction);
    }
 
 
    /**
     * 巡检间隔接口
     * 请求参数    参数1    hour(float):巡检间隔    是    2
     *     参数示例
     * http://192.168.10.45:8085/InspectionIntervals?hour=2
     * 返回参数    参数1
     *     参数示例
     * 巡检间隔已设置: 2.0 h/次。
     *
     */
    @PostMapping("setInspectionInterval")
    public Response setInspectionInterval(@RequestParam float hour){
 
        return service.setInspectionInterval(hour);
    }
 
    /**
     * 巡检间隔接口
     * 请求参数    参数1    hour(float):巡检间隔    是    2
     *     参数示例
     * http://192.168.10.45:8085/InspectionIntervals?hour=2
     * 返回参数    参数1
     *     参数示例
     * 巡检间隔已设置: 2.0 h/次。
     *
     */
    @PostMapping("setEnvironmentThreshold")
    public Response setEnvironmentThreshold(@RequestBody EnvironmentThreshold threshold){
        return service.setEnvironmentThreshold(threshold);
    }
 
    @GetMapping("getEnvironmentThreshold")
    public Response getEnvironmentThreshold(){
        return service.getEnvironmentThreshold();
    }
 
    @ApiOperation("查询分页-巡检记录")
    @GetMapping("getPageOfInspectionRecord")
    public Response<PageInfo<InspectionRecord>> getPageOfInspectionRecord(@RequestParam int pageNum, @RequestParam int pageSize,
                                                                          @RequestParam(required = false) String startDate, @RequestParam(required = false) String endDate){
 
        return service.getPageOfInspectionRecord(pageNum,pageSize,startDate,endDate);
    }
 
 
}