配置ESB动作流的类模版

#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模版的使用

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

- 文件的名称: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模版的使用

下边的内容不要在看了,不要在使用了!!!
====================== 下边的内容只是做参考,不要按照操作了===================

在上图箭头指向的位置添加如下的代码:
#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
}
新建类

评论区