package org.jeecg.modules.dry.controller; import com.alibaba.fastjson.JSONObject; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.jeecg.common.api.vo.Result; import org.jeecg.modules.dry.entity.DryHelloEntity; import org.jeecg.modules.dry.service.IDryHelloService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import lombok.extern.slf4j.Slf4j; import java.util.Map; @Api(tags = "dry示例") @RestController @RequestMapping("/dry") @Slf4j public class DryHelloController { @Autowired private IDryHelloService jeecgHelloService; @ApiOperation(value = "hello", notes = "对外服务接口") @GetMapping(value = "/hello") public String sayHello() { log.info(" ---我被调用了--- "); return jeecgHelloService.hello(); } @ApiOperation(value="接收实时数据Str", notes="设备实时数据上传") @PostMapping("/sendRealTimeData") public Result realTimeData(String orderVo) { System.out.println("接收到实时数据:" + orderVo.toString()); log.info("实时数据:"+ orderVo.toString()); //service.saveRealTimeData(orderVo); return Result.ok(); } @ApiOperation(value="接收实时数据Map", notes="设备实时数据上传") @PostMapping("/sendRealTimeDataMap") public Result realTimeDataMap(@RequestBody Map orderVo) { System.out.println("接收到实时数据:" + orderVo.toString()); log.info("实时数据:"+ orderVo.toString()); //service.saveRealTimeData(orderVo); return Result.ok(); } @ApiOperation(value="接收实时数据Json", notes="设备实时数据上传") @PostMapping("/sendRealTimeDataJson") public Result realTimeDataJson(@RequestBody JSONObject orderVo) { System.out.println("接收到实时数据:" + orderVo.toJSONString()); log.info("实时数据:"+orderVo.toJSONString()); //service.saveRealTimeData(orderVo); return Result.ok(); } }