| | |
| | | */ |
| | | @PostMapping(value = "/message") |
| | | public AjaxResult<String> message(@RequestBody JSONObject jsonObject) throws IOException { |
| | | log.info("接收到消息中转:{}",jsonObject.toJSONString()); |
| | | JSONObject body = jsonObject.getJSONObject("notify_data").getJSONObject("body"); |
| | | JSONObject content = null; |
| | | try { |
| | |
| | | String nodeId = header.getString("node_id"); // 设备编号 |
| | | String productId = header.getString("product_id"); // 产品id |
| | | String service_id = content.getString("service_id"); |
| | | if(!SendTagConstant.PING.equals(service_id)){ |
| | | log.info("收到IOT发送的消息:{}",jsonObject.toJSONString()); |
| | | } |
| | | // log.info("服务id:{}",service_id); |
| | | ChargingMessage chargingMessage = new ChargingMessage(); |
| | | chargingMessage.setServiceId(service_id); |