侧边栏壁纸
博主头像
程序员の小站博主等级

行动起来,活在当下

  • 累计撰写 51 篇文章
  • 累计创建 35 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

E10--二次开发动作流代码模版(File And Code Template)

Administrator
2025-04-04 / 0 评论 / 0 点赞 / 8 阅读 / 5837 字
温馨提示:
本文最后更新于 2025-04-04,若内容或图片失效,请留言反馈。部分素材来自网络,若不小心影响到您的利益,请联系我们删除。

配置ESB动作流的类模版

image.png

#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "") package ${PACKAGE_NAME};#end  
  
  
import com.alibaba.fastjson.JSON;  
import com.weaver.common.base.entity.result.WeaResult;  
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;  
import lombok.extern.slf4j.Slf4j;  
import org.springframework.stereotype.Service;  
  
import java.util.*;  
  
/**  
 * @author Mr Wang  
 * @Date ${YEAR}-${MONTH}-${DAY} ${TIME}  
 * @Description ${Description}  
 * @version 1.0  
 **/@Slf4j  
@Service("${NAME.substring(0,1).toLowerCase()}${NAME.substring(1)}")  
public class ${NAME}  implements EsbServerlessRpcRemoteInterface {  
  
    @Override  
    public WeaResult<Map<String, Object>> execute(Map<String, Object> params) {  
        log.info("调用动作流接口传入的参数为:{}", JSON.toJSONString(params));  
  
  
  
        return WeaResult.success(null);  
    }  
}

ESB模版的使用

image.png

配置ESB动作流的dubbo.xml文件模版

image.png

  • 文件的名称:applicationContext-secondev-secondev-dubbo.xml

内容体

<?xml version="1.0" encoding="UTF-8"?>  
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dubbo="http://code.alibabatech.com/schema/dubbo" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd   http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">  
  
    <dubbo:service ref=""  
                   interface="com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface"  
                   group="" />  
  
</beans>

Xml模版的使用

image.png

下边的内容不要在看了,不要在使用了!!!

====================== 下边的内容只是做参考,不要按照操作了===================
image.png

在上图箭头指向的位置添加如下的代码:

#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")
package ${PACKAGE_NAME};
#end

#if(${ESB_ACTION_ENABLE} == "Y")
import com.alibaba.fastjson.JSON;
import com.weaver.common.base.entity.result.WeaResult;
import com.weaver.esb.api.rpc.EsbServerlessRpcRemoteInterface;
import org.springframework.stereotype.Service;
import java.util.*;
#end

import lombok.extern.slf4j.Slf4j;

/**
 * @author Mr Wang
 * @Date ${YEAR}-${MONTH}-${DAY} ${TIME}
 * @Description ${Description}
 * @version 1.0
 **/
 @Slf4j
 #if(${ESB_ACTION_ENABLE} == "Y")
 @Service("${NAME.substring(0,1).toLowerCase()}${NAME.substring(1)}")
 #end
public class ${NAME} #if(${ESB_ACTION_ENABLE} == "Y") implements EsbServerlessRpcRemoteInterface #end{
    #if(${ESB_ACTION_ENABLE} == "Y")
    @Override
    public WeaResult<Map<String, Object>> execute(Map<String, Object> params) {
        log.info("调用动作流接口传入的参数为:{}", JSON.toJSONString(params));



        return WeaResult.success(null);
    }
    #end
}

新建类

image.png

0

评论区