首页 > 其他分享 >7

7

时间:2024-11-20 09:58:20浏览次数:1  
标签: web springframework demo11 org import annotation

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;

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 {



}

标签:,web,springframework,demo11,org,import,annotation
From: https://www.cnblogs.com/luoqingci/p/18556206

相关文章