diff --git a/doc/docs/_sidebar.md b/doc/docs/_sidebar.md index c5f5fbde..8389b904 100644 --- a/doc/docs/_sidebar.md +++ b/doc/docs/_sidebar.md @@ -1,12 +1,13 @@ -* [首页](/?t=1553564490530) +* [首页](/?t=1553566189196) * 开发文档 - * [快速体验](files/10010_快速体验.md?t=1553564490530) - * [项目接入到SOP](files/10011_项目接入到SOP.md?t=1553564490570) - * [新增接口](files/10020_新增接口.md?t=1553564490570) - * [业务参数校验](files/10030_业务参数校验.md?t=1553564490570) - * [错误处理](files/10040_错误处理.md?t=1553564490571) - * [接口交互详解](files/10050_接口交互详解.md?t=1553564490571) - * [使用SpringCloudGateway](files/10060_使用SpringCloudGateway.md?t=1553564490571) + * [快速体验](files/10010_快速体验.md?t=1553566189197) + * [项目接入到SOP](files/10011_项目接入到SOP.md?t=1553566189214) + * [新增接口](files/10020_新增接口.md?t=1553566189215) + * [业务参数校验](files/10030_业务参数校验.md?t=1553566189215) + * [错误处理](files/10040_错误处理.md?t=1553566189215) + * [接口交互详解](files/10050_接口交互详解.md?t=1553566189215) + * [使用SpringCloudGateway](files/10060_使用SpringCloudGateway.md?t=1553566189215) + * [easyopen支持](files/10070_easyopen支持.md?t=1553566189215) * 原理分析 - * [原理分析之@ApiMapping](files/90010_原理分析之@ApiMapping.md?t=1553564490571) - * [原理分析之路由存储](files/90011_原理分析之路由存储.md?t=1553564490571) + * [原理分析之@ApiMapping](files/90010_原理分析之@ApiMapping.md?t=1553566189215) + * [原理分析之路由存储](files/90011_原理分析之路由存储.md?t=1553566189215) diff --git a/doc/docs/files/10070_easyopen支持.md b/doc/docs/files/10070_easyopen支持.md new file mode 100644 index 00000000..37e3fad7 --- /dev/null +++ b/doc/docs/files/10070_easyopen支持.md @@ -0,0 +1,63 @@ +# easyopen支持 + +SOP对easyopen项目提供了很好的支持,如果您的服务端使用了easyopen框架,相关配置步骤如下: + +## 服务端配置 + +首先是服务端相关配置 + +- pom添加依赖 + +```xml + + + com.gitee.sop + sop-service-common + 1.0.0-SNAPSHOT + + + org.springframework.cloud + spring-cloud-starter-netflix-eureka-client + + + net.oschina.durcframework + easyopen + 1.16.1 + + +``` + +easyopen版本必须升级到1.16.1 + +- 启动类上面添加注解@EnableDiscoveryClient,将自己注册到注册中心 +- 新增一个配置类,继承EasyopenServiceConfiguration,内容为空 + +```java +@Configuration +public class SopConfig extends EasyopenServiceConfiguration { +} +``` + +服务端配置完毕,重启服务。 + +## 网关端配置 + +接下来是网关的配置 + +- 打开ZuulConfig.java,注释掉原本的@Configuration,新增如下Configuration + +```java +@Configuration +public class ZuulConfig extends EasyopenZuulConfiguration { + { + Map appSecretStore = new HashMap(); + // 秘钥键值对 + appSecretStore.put("easyopen_test", "G9w0BAQEFAAOCAQ8AMIIBCgKCA"); + ApiContext.getApiConfig().addAppSecret(appSecretStore); + } +} +``` + +配置完毕,重启网关服务,可运行测试用例`EasyopenClientPostTest.java`验证 + +**注:** 配置完成后easyopen签名校验将会关闭,改用网关端来校验;网关对easyopen返回的结果不进行处理,直接返回服务端的结果。