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> getPageOfInspectionRecord(@RequestParam int pageNum, @RequestParam int pageSize, @RequestParam(required = false) String startDate, @RequestParam(required = false) String endDate){ return service.getPageOfInspectionRecord(pageNum,pageSize,startDate,endDate); } }