package com.fastbee.data.controller.deviceData;

import com.fastbee.common.core.domain.AjaxResult;
import com.fastbee.deviceData.service.impl.DeviceRealtimedataMeteorologyServiceImpl;
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 DeviceRealtimedataMeteorologyServiceImpl deviceRealtimedataMeteorologyService;

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