parent
f9560f9e30
commit
2f368ec52a
@ -1,12 +1,13 @@ |
|||||||
* [首页](/?t=1553564490530) |
* [首页](/?t=1553566189196) |
||||||
* 开发文档 |
* 开发文档 |
||||||
* [快速体验](files/10010_快速体验.md?t=1553564490530) |
* [快速体验](files/10010_快速体验.md?t=1553566189197) |
||||||
* [项目接入到SOP](files/10011_项目接入到SOP.md?t=1553564490570) |
* [项目接入到SOP](files/10011_项目接入到SOP.md?t=1553566189214) |
||||||
* [新增接口](files/10020_新增接口.md?t=1553564490570) |
* [新增接口](files/10020_新增接口.md?t=1553566189215) |
||||||
* [业务参数校验](files/10030_业务参数校验.md?t=1553564490570) |
* [业务参数校验](files/10030_业务参数校验.md?t=1553566189215) |
||||||
* [错误处理](files/10040_错误处理.md?t=1553564490571) |
* [错误处理](files/10040_错误处理.md?t=1553566189215) |
||||||
* [接口交互详解](files/10050_接口交互详解.md?t=1553564490571) |
* [接口交互详解](files/10050_接口交互详解.md?t=1553566189215) |
||||||
* [使用SpringCloudGateway](files/10060_使用SpringCloudGateway.md?t=1553564490571) |
* [使用SpringCloudGateway](files/10060_使用SpringCloudGateway.md?t=1553566189215) |
||||||
|
* [easyopen支持](files/10070_easyopen支持.md?t=1553566189215) |
||||||
* 原理分析 |
* 原理分析 |
||||||
* [原理分析之@ApiMapping](files/90010_原理分析之@ApiMapping.md?t=1553564490571) |
* [原理分析之@ApiMapping](files/90010_原理分析之@ApiMapping.md?t=1553566189215) |
||||||
* [原理分析之路由存储](files/90011_原理分析之路由存储.md?t=1553564490571) |
* [原理分析之路由存储](files/90011_原理分析之路由存储.md?t=1553566189215) |
||||||
|
@ -0,0 +1,63 @@ |
|||||||
|
# easyopen支持 |
||||||
|
|
||||||
|
SOP对easyopen项目提供了很好的支持,如果您的服务端使用了easyopen框架,相关配置步骤如下: |
||||||
|
|
||||||
|
## 服务端配置 |
||||||
|
|
||||||
|
首先是服务端相关配置 |
||||||
|
|
||||||
|
- pom添加依赖 |
||||||
|
|
||||||
|
```xml |
||||||
|
<!-- sop接入依赖 --> |
||||||
|
<dependency> |
||||||
|
<groupId>com.gitee.sop</groupId> |
||||||
|
<artifactId>sop-service-common</artifactId> |
||||||
|
<version>1.0.0-SNAPSHOT</version> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>org.springframework.cloud</groupId> |
||||||
|
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> |
||||||
|
</dependency> |
||||||
|
<dependency> |
||||||
|
<groupId>net.oschina.durcframework</groupId> |
||||||
|
<artifactId>easyopen</artifactId> |
||||||
|
<version>1.16.1</version> |
||||||
|
</dependency> |
||||||
|
<!-- sop接入依赖 end --> |
||||||
|
``` |
||||||
|
|
||||||
|
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<String, String> appSecretStore = new HashMap(); |
||||||
|
// 秘钥键值对 |
||||||
|
appSecretStore.put("easyopen_test", "G9w0BAQEFAAOCAQ8AMIIBCgKCA"); |
||||||
|
ApiContext.getApiConfig().addAppSecret(appSecretStore); |
||||||
|
} |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
配置完毕,重启网关服务,可运行测试用例`EasyopenClientPostTest.java`验证 |
||||||
|
|
||||||
|
**注:** 配置完成后easyopen签名校验将会关闭,改用网关端来校验;网关对easyopen返回的结果不进行处理,直接返回服务端的结果。 |
Loading…
Reference in new issue