package com.casic.controller; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.casic.model.DataReportParam; import com.casic.model.ResponseData; import com.casic.service.DeviceDataService; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.Map; @Slf4j @RequestMapping("/data") @RestController public class DeviceDataController { private final DeviceDataService dataService; public DeviceDataController(DeviceDataService dataService) { this.dataService = dataService; } // @PostMapping("/gas/receiver") // public String gasReceiver(@RequestBody Map map) { // log.info("---------"+JSON.toJSONString(map)); // return "200"; // } @PostMapping("/gas/receiver") public ResponseData gasReceiver(@RequestBody DataReportParam dataReportParam) { log.info("---------"+JSON.toJSONString(dataReportParam)); return dataService.gasReceiver(dataReportParam); } }