package com.fastbee.data.controller.deviceData;

import com.fastbee.common.core.domain.AjaxResult;
import com.fastbee.deviceData.service.impl.DeviceRealtimedataMoistureServiceImpl;
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("/moisture")
public class DeviceRealtimedataMoistureController {
    @Autowired
    private DeviceRealtimedataMoistureServiceImpl deviceRealtimedataMoistureServiceImpl;

    /**
     * 获取最新一条墒情数据
     * @return
     */
    @GetMapping("/weather/realtimedata")
    public AjaxResult getLatestWeatherRealtimedata() {
        return AjaxResult.success(deviceRealtimedataMoistureServiceImpl.getLatestWeatherRealtimedata());
    }
}
