2021与蓝度共同重构项目,服务端
zhanzhiqin
2022-03-23 f93146336b1a24b0497ae0c6fa6676e4468e35b3
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/LightPoleHeelingController.java
@@ -2,13 +2,13 @@
import com.sandu.common.domain.ResponseVO;
import com.sandu.common.util.ResponseUtil;
import com.sandu.ximon.admin.param.C3ChargingParam;
import com.sandu.ximon.admin.param.LightPoleHeelingParam;
import com.sandu.ximon.admin.service.LightPoleHeelingService;
import com.sandu.ximon.dao.domain.LightPoleHeeling;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -37,4 +37,55 @@
        List<LightPoleHeeling> list = lightPoleHeelingService.listLightPoleHeelingByKeyword(keyword);
        return ResponseUtil.successPage(list);
    }
    /**
     * 灯杆倾斜心跳包
     *
     * @return
     */
    @PostMapping("/LightPoleHeelingHeartbeatPackage")
    public ResponseVO<Object> LightPoleHeelingHeartbeatPackage(@RequestBody @Validated LightPoleHeelingParam lightPoleHeelingParam) {
        return ResponseUtil.success(lightPoleHeelingService.LightPoleHeelingHeartbeatPackage(lightPoleHeelingParam.getDeviceName()));
    }
    /**
     * 查询心跳包间隔时间
     *
     * @return
     */
    @PostMapping("/QueryIntervalTime")
    public ResponseVO<Object> QueryIntervalTime(@RequestBody @Validated LightPoleHeelingParam lightPoleHeelingParam) {
        return ResponseUtil.success(lightPoleHeelingService.QueryIntervalTime(lightPoleHeelingParam.getDeviceName()));
    }
    /**
     * 灯杆倾斜软重启
     *
     * @return
     */
    @PostMapping("/RestartLightPoleHeeling")
    public ResponseVO<Object> RestartLightPoleHeeling(@RequestBody @Validated LightPoleHeelingParam lightPoleHeelingParam) {
        return ResponseUtil.success(lightPoleHeelingService.RestartLightPoleHeeling(lightPoleHeelingParam.getDeviceName()));
    }
    /**
     * 设置心跳包间隔时间(秒)
     */
    @PostMapping("/SetHeartbeatPacketTime")
    public ResponseVO<Object> SetHeartbeatPacketTime(@RequestBody @Validated LightPoleHeelingParam lightPoleHeelingParam) {
        return ResponseUtil.success(lightPoleHeelingService.SetHeartbeatPacketTime(lightPoleHeelingParam.getDeviceName(), lightPoleHeelingParam.getTime()));
    }
    /**
     * 设置传感器为初始状态
     */
    @PostMapping("/SetSensorState")
    public ResponseVO<Object> SetSensorState(@RequestBody @Validated LightPoleHeelingParam lightPoleHeelingParam) {
        return ResponseUtil.success(lightPoleHeelingService.SetSensorState(lightPoleHeelingParam.getDeviceName()));
    }
}