package com.fastbee.data.controller.aaScreenAgricultural.deviceRealTimeData;

import com.fastbee.common.core.domain.AjaxResult;
import com.fastbee.deviceData.service.IDeviceRealtimedataMeteorologyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 气象设备实时数据
 */
@RestController()
@RequestMapping("/meteorology")
public class DeviceRealtimedataMeteorologyController {

    @Autowired
    private IDeviceRealtimedataMeteorologyService deviceRealtimedataMeteorologyService;

    /**
     * 获取最新的一条气象数据
     */
    @GetMapping(value = "/weather/realtimedata")
    public AjaxResult getLatestWeatherRealtimedata() {
        return AjaxResult.success(deviceRealtimedataMeteorologyService.getLatestWeatherRealtimedata());
    }

}
