浏览代码

优化common

java110 3 年之前
父节点
当前提交
ceab91b902
共有 1 个文件被更改,包括 22 次插入0 次删除
  1. 22 0
      springboot/src/main/java/com/java110/boot/smo/impl/ApiCallBackInnerServiceSMOImpl.java

+ 22 - 0
springboot/src/main/java/com/java110/boot/smo/impl/ApiCallBackInnerServiceSMOImpl.java

@@ -0,0 +1,22 @@
+package com.java110.boot.smo.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.boot.websocket.ParkingAreaWebsocket;
+import com.java110.intf.api.IApiCallBackInnerServiceSMO;
+import com.java110.utils.exception.SMOException;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+public class ApiCallBackInnerServiceSMOImpl implements IApiCallBackInnerServiceSMO {
+    @Override
+    public int webSentParkingArea(@RequestBody JSONObject reqJson) {
+        JSONObject param = JSONObject.parseObject(reqJson.toString());
+        try {
+            ParkingAreaWebsocket.sendInfo(param.toJSONString(), param.getString("extBoxId"));
+        } catch (Exception e) {
+            throw new SMOException(e.getMessage());
+        }
+        return 1;
+    }
+}