|
@@ -4,6 +4,7 @@ import cn.hutool.json.JSONObject;
|
|
|
import com.jpsoft.smart.lapi.dto.LapiResponse;
|
|
|
import com.jpsoft.smart.modules.lapi.channel.LapiAttrKeys;
|
|
|
import com.jpsoft.smart.modules.lapi.channel.LapiChannel;
|
|
|
+import com.jpsoft.smart.modules.lapi.utils.LapiSessionUtil;
|
|
|
import io.netty.channel.ChannelHandler;
|
|
|
import io.netty.channel.ChannelHandlerContext;
|
|
|
import io.netty.channel.SimpleChannelInboundHandler;
|
|
@@ -17,9 +18,6 @@ import java.util.concurrent.BlockingQueue;
|
|
|
@Component
|
|
|
@ChannelHandler.Sharable
|
|
|
public class ResponseDataHandler extends SimpleChannelInboundHandler<LapiResponse> {
|
|
|
- @Autowired
|
|
|
- private Map<String, LapiChannel> activeLapiChannelMap;
|
|
|
-
|
|
|
@Override
|
|
|
protected void channelRead0(ChannelHandlerContext ctx, LapiResponse msg) throws Exception {
|
|
|
JSONObject jsonObject = msg.getData();
|
|
@@ -27,7 +25,7 @@ public class ResponseDataHandler extends SimpleChannelInboundHandler<LapiRespons
|
|
|
String uri = jsonObject.getJSONObject("Response").get("ResponseURL").toString();
|
|
|
String deviceNo = ctx.channel().attr(LapiAttrKeys.DEVICE_NO).get();
|
|
|
|
|
|
- BlockingQueue<String> queue = activeLapiChannelMap.get(deviceNo).getReceivePacketQueue(uri);
|
|
|
+ BlockingQueue<String> queue = LapiSessionUtil.get(deviceNo).getReceivePacketQueue(uri);
|
|
|
|
|
|
queue.put(jsonObject.toString());
|
|
|
}
|