提交 d1e0846f 编写于 作者: zhouweidong's avatar zhouweidong

feign serviceId动态化配置

上级 fd33cc66
...@@ -40,6 +40,7 @@ zuul: ...@@ -40,6 +40,7 @@ zuul:
<#assign serviceId=systemName+"-"+sysApi> <#assign serviceId=systemName+"-"+sysApi>
</#if> </#if>
<#if serviceId!=""> <#if serviceId!="">
<#assign serviceId="$"+"{ibiz.ref.service."+serviceId+":"+serviceId+"}">
${appEntity}: ${appEntity}:
path: /${serviceUrl}/** path: /${serviceUrl}/**
serviceId: ${serviceId} serviceId: ${serviceId}
...@@ -49,30 +50,30 @@ zuul: ...@@ -49,30 +50,30 @@ zuul:
<#if haswfentity==true> <#if haswfentity==true>
wfcore: wfcore:
path: /wfcore/** path: /wfcore/**
serviceId: ibzwf-api serviceId: ${r'${ibiz.ref.service.wf:ibzwf-api}'}
stripPrefix: true stripPrefix: true
</#if> </#if>
<#if sys.getPSSystemSetting()?? && sys.getPSSystemSetting().getDataAccCtrlArch()?? && sys.getPSSystemSetting().getDataAccCtrlArch()==1> <#if sys.getPSSystemSetting()?? && sys.getPSSystemSetting().getDataAccCtrlArch()?? && sys.getPSSystemSetting().getDataAccCtrlArch()==1>
loginv7: loginv7:
path: /v7/login path: /v7/login
serviceId: ibzuaa-api serviceId: ${r'${ibiz.ref.service.uaa:ibzuaa-api}'}
stripPrefix: false stripPrefix: false
changepwd: changepwd:
path: /v7/changepwd path: /v7/changepwd
serviceId: ibzuaa-api serviceId: ${r'${ibiz.ref.service.uaa:ibzuaa-api}'}
stripPrefix: false stripPrefix: false
uaa: uaa:
path: /uaa/** path: /uaa/**
serviceId: ibzuaa-api serviceId: ${r'${ibiz.ref.service.uaa:ibzuaa-api}'}
stripPrefix: false stripPrefix: false
config: config:
path: /config/** path: /config/**
serviceId: ibzuaa-api serviceId: ${r'${ibiz.ref.service.uaa:ibzuaa-api}'}
stripPrefix: false stripPrefix: false
<#if sys.getCodeName()!='ibzou' && sys.getCodeName()!='ibzrt'> <#if sys.getCodeName()!='ibzou' && sys.getCodeName()!='ibzrt'>
oucore: oucore:
path: /ibzorganizations/** path: /ibzorganizations/**
serviceId: ibzou-api serviceId: ${r'${ibiz.ref.service.ou:ibzou-api}'}
stripPrefix: false stripPrefix: false
</#if> </#if>
</#if> </#if>
......
...@@ -25,10 +25,15 @@ import org.springframework.cloud.openfeign.FeignClient; ...@@ -25,10 +25,15 @@ import org.springframework.cloud.openfeign.FeignClient;
</#if> </#if>
<#comment>contextId存在下划线时,项目运行报错,模板中转中划线处理</#comment> <#comment>contextId存在下划线时,项目运行报错,模板中转中划线处理</#comment>
<#assign contextId=item.codeName?replace("_","-")> <#assign contextId=item.codeName?replace("_","-")>
<#if ((item.getPSSubSysServiceAPI().getServiceCodeName())!'')!=''>
<#assign serviceId="$"+"{ibiz.ref.service."+item.getPSSubSysServiceAPI().getServiceCodeName()+":"+item.getPSSubSysServiceAPI().getServiceCodeName()+"}">
<#else>
<#assign serviceId="$"+"{ibiz.ref.service."+item.getPSSubSysServiceAPI().codeName+":}">
</#if>
/** /**
* 实体[${item.codeName}] 服务对象接口 * 实体[${item.codeName}] 服务对象接口
*/ */
@FeignClient(value = "${(item.getPSSubSysServiceAPI().getServiceCodeName())!''}", contextId = "${contextId}", fallback = ${item.codeName}Fallback.class) @FeignClient(value = "${serviceId}", contextId = "${contextId}", fallback = ${item.codeName}Fallback.class)
public interface ${item.codeName}FeignClient { public interface ${item.codeName}FeignClient {
<#if item.getPSSubSysServiceAPIDEMethods()??> <#if item.getPSSubSysServiceAPIDEMethods()??>
......
...@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.PathVariable; ...@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
@FeignClient(value = "ibzou-api",fallback = IBZOUFallback.class) @FeignClient(value = "${r'${ibiz.ref.service.ou:ibzou-api}'}",fallback = IBZOUFallback.class)
public interface IBZOUFeignClient public interface IBZOUFeignClient
{ {
/** /**
......
...@@ -10,7 +10,7 @@ import org.springframework.cloud.openfeign.FeignClient; ...@@ -10,7 +10,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
@FeignClient(value = "ibzuaa-api",fallback = IBZUAAFallback.class) @FeignClient(value = "${r'${ibiz.ref.service.uaa:ibzuaa-api}'}",fallback = IBZUAAFallback.class)
public interface IBZUAAFeignClient public interface IBZUAAFeignClient
{ {
/** /**
......
...@@ -7,7 +7,7 @@ import org.springframework.cloud.openfeign.FeignClient; ...@@ -7,7 +7,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.*; import java.util.*;
@FeignClient(value = "ibzwf-api",fallback = IBZWFFallback.class) @FeignClient(value = "${r'${ibiz.ref.service.wf:ibzwf-api}'}",fallback = IBZWFFallback.class)
public interface IBZWFFeignClient public interface IBZWFFeignClient
{ {
@RequestMapping(method = RequestMethod.GET, value = "/{system}-app-{appname}/{entity}/process-definitions/{processDefinitionKey}/usertasks/{taskDefinitionKey}/tasks") @RequestMapping(method = RequestMethod.GET, value = "/{system}-app-{appname}/{entity}/process-definitions/{processDefinitionKey}/usertasks/{taskDefinitionKey}/tasks")
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册