java110
2022-02-22 70eef2c48a63737a10dcf31a9b5c6a11a3debe1c
java110-core/src/main/java/com/java110/core/event/cmd/ServiceCmdEventPublishing.java
@@ -3,6 +3,7 @@
import com.alibaba.fastjson.JSONObject;
import com.java110.core.context.ICmdDataFlowContext;
import com.java110.core.event.center.DataFlowListenerOrderComparator;
import com.java110.core.log.LoggerFactory;
import com.java110.dto.CmdListenerDto;
import com.java110.utils.constant.CommonConstant;
import com.java110.utils.constant.ResponseConstant;
@@ -13,8 +14,6 @@
import com.java110.utils.log.LoggerEngine;
import com.java110.utils.util.Assert;
import org.slf4j.Logger;
import com.java110.core.log.LoggerFactory;
import sun.misc.ProxyGenerator;
import java.io.File;
@@ -198,32 +197,32 @@
    protected static void invokeListener(ServiceCmdListener listener, CmdEvent event) {
        try {
            //        //这里处理业务逻辑数据
        ICmdDataFlowContext dataFlowContext = event.getCmdDataFlowContext();
        //获取请求数据
        JSONObject reqJson = dataFlowContext.getReqJson();
            ICmdDataFlowContext dataFlowContext = event.getCmdDataFlowContext();
            //获取请求数据
            JSONObject reqJson = dataFlowContext.getReqJson();
        logger.debug("API服务 --- 请求参数为:{}", reqJson.toJSONString());
            logger.debug("API服务 --- 请求参数为:{}", reqJson.toJSONString());
            listener.validate(event, dataFlowContext, reqJson);
            listener.doCmd(event, dataFlowContext, reqJson);
        //logger.debug("API服务 --- 返回报文信息:{}", dataFlowContext.getResponseEntity());
         //   listener.cmd(event);
            //logger.debug("API服务 --- 返回报文信息:{}", dataFlowContext.getResponseEntity());
            //   listener.cmd(event);
        } catch (CmdException e) {
            LoggerEngine.error("发布侦听失败", e);
            throw e;
        }
    }
    public static void testPoxy(Class clazz){
    public static void testPoxy(Class clazz) {
        byte[] bytes = ProxyGenerator.generateProxyClass("$Proxy", new Class[]{clazz});
        try(
                FileOutputStream fos =new FileOutputStream(new File("D:/$Proxy.class"))
        ){
        try (
                FileOutputStream fos = new FileOutputStream(new File("D:/$Proxy.class"))
        ) {
            fos.write(bytes);
            fos.flush();
        }catch (Exception e){
        } catch (Exception e) {
            e.printStackTrace();
        }
    }