package com.usky.iot.controller.web;

import com.usky.common.core.bean.ApiResult;
import com.usky.iot.service.BaseAlarmService;
import com.usky.iot.service.DmpDataInfoService;
import com.usky.iot.service.DmpDeviceStatusService;
import com.usky.backend.domain.request.DmpDeviceDataRequestVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author zyj
 * @date 2023/6/8 13:52:05
 */
@RestController
@RequestMapping("/deviceHttp")
public class DeviceHttpController {

    @Autowired
    private BaseAlarmService baseAlarmService;

    @Autowired
    private DmpDataInfoService dmpDataInfoService;

    @GetMapping(value = "/status")
    public ApiResult<Void> status(){
        baseAlarmService.status();
        return ApiResult.success();
    }

    /**
     * 设备实时历史数据-对接客户
     * @param dmpDeviceDataRequestVO
     * @return
     */
    @PostMapping("/data")
    public ApiResult<Void> data(@RequestBody DmpDeviceDataRequestVO dmpDeviceDataRequestVO){
        dmpDataInfoService.data(dmpDeviceDataRequestVO);
        return ApiResult.success();
    }


}
