package com.newfiber.api.pc.controller; import com.newfiber.api.core.commons.ResultCode; import com.newfiber.api.core.commons.ResultObj; import com.newfiber.api.pc.model.vo.InstantaneousFlowVo; import com.newfiber.api.pc.model.vo.PumpFiveSecDataFatherVo; import com.newfiber.api.pc.model.vo.PumpFiveSecDataVo; import com.newfiber.api.pc.service.AutomaticRealtimeDataDisplayService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.List; /** * 自控实时数据展示控制层 * @description: TODO * @author: 张鸿志 * @date: 2020/12/21 10:48 * @version: v1.0 */ @RestController @RequestMapping("/automatic") @Api(value = "AutomaticRealtimeDataDisplayController",tags = "自控实时数据展示控制层") public class AutomaticRealtimeDataDisplayController { @Autowired private AutomaticRealtimeDataDisplayService automaticRealtimeDataDisplayService; @PostMapping("/findData") @ApiOperation("根据泵站编号获取栅格液位以及瞬时流量-暂时按每5分钟刷新一次") public ResultObj<InstantaneousFlowVo> queryAutomaticRealtimeDataDisplay(@RequestParam("pumpStationNo") String pumpStationNo){ return new ResultObj<>(ResultCode.OK,automaticRealtimeDataDisplayService.queryAutomaticRealtimeDataDisplay(pumpStationNo)); } @PostMapping("/fiveSecond") @ApiOperation("每5秒钟更新一次泵机电压电流等信息") public ResultObj<PumpFiveSecDataFatherVo> findPumpData(@RequestParam("pumpStationNo")String pumpStationNo){ return new ResultObj<>(ResultCode.OK,automaticRealtimeDataDisplayService.findPumpDataSimlate(pumpStationNo)); } }