package com.example.demo11.Controller;
import com.example.demo11.Service.DeviceDataService;
import com.example.demo11.entity.DeviceData;
import com.example.demo11.entity.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
//设备实时数据
@RestController
@RequestMapping("/deviceData")
public class DeviceDataController {
@Autowired
private DeviceDataService deviceDataService;
@GetMapping("/getData")
public Result<DeviceData> getData(@RequestBody DeviceData deviceData){
//TODO: 从数据库中获取设备实时数据
deviceDataService.getById(deviceData.getId());
return Result.success(deviceData);
}
}
package com.example.demo11.Controller;标签:,web,springframework,demo11,org,import,annotation From: https://www.cnblogs.com/luoqingci/p/18556206
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;
@RestController
@RequestMapping("/fixtures")
public class FixturesController {
}