diff --git a/README.md b/README.md index 941fa39b..686a08e9 100644 --- a/README.md +++ b/README.md @@ -41,12 +41,11 @@ SOP封装了开放平台大部分功能包括:签名验证、统一异常处 - 接入方管理+秘钥管理 - 接口权限分配 - SDK +- 接口限流 +- 文档整合 ## 后期规划 -- 文档整合 -- springmvc项目接入demo -- 限流 - 监控 ## admin界面预览 @@ -66,10 +65,11 @@ SOP封装了开放平台大部分功能包括:签名验证、统一异常处 - doc:开发文档 - sop-registry:注册中心,eureka实现 - sop-gateway:网关,统一访问入口,Spring Cloud Zuul实现,可切换成Spring Cloud Gateway -- sop-common:公共模块,封装常用功能,包含签名校验、错误处理等功能 -- sop-example:微服务示例 +- sop-common:公共模块,封装常用功能,包含签名校验、错误处理、限流等功能 +- sop-example:微服务示例,含springboot,springmvc示例 - sop-sdk:基础sdk,含Java、C#版本 - sop-test:接口调用测试用例 +- sop-website:开放平台对应网站,提供文档API等内容 ## 相关文档 diff --git a/changelog.md b/changelog.md index f3137375..626ddb51 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # changelog +## 1.3.0 + +- 新增接口限流功能 +- 新增文档整合功能 +- 新增springmvc项目接入demo + ## 1.2.0 - SOP Admin新增用户登录 diff --git a/doc/docs/_sidebar.md b/doc/docs/_sidebar.md index 4d2a77b1..17a202cf 100644 --- a/doc/docs/_sidebar.md +++ b/doc/docs/_sidebar.md @@ -1,18 +1,20 @@ -* [首页](/?t=1554693919573) +* [首页](/?t=1555326144824) * 开发文档 - * [快速体验](files/10010_快速体验.md?t=1554693919573) - * [项目接入到SOP](files/10011_项目接入到SOP.md?t=1554693919596) - * [新增接口](files/10020_新增接口.md?t=1554693919596) - * [业务参数校验](files/10030_业务参数校验.md?t=1554693919596) - * [错误处理](files/10040_错误处理.md?t=1554693919596) - * [接口交互详解](files/10050_接口交互详解.md?t=1554693919596) - * [使用SpringCloudGateway](files/10060_使用SpringCloudGateway.md?t=1554693919596) - * [easyopen支持](files/10070_easyopen支持.md?t=1554693919596) - * [使用签名校验工具](files/10080_使用签名校验工具.md?t=1554693919596) - * [ISV管理](files/10085_ISV管理.md?t=1554693919596) - * [路由授权](files/10090_路由授权.md?t=1554693919596) - * [SDK开发](files/10095_SDK开发.md?t=1554693919597) + * [快速体验](files/10010_快速体验.md?t=1555326144827) + * [项目接入到SOP](files/10011_项目接入到SOP.md?t=1555326144859) + * [新增接口](files/10020_新增接口.md?t=1555326144859) + * [业务参数校验](files/10030_业务参数校验.md?t=1555326144859) + * [错误处理](files/10040_错误处理.md?t=1555326144859) + * [编写文档](files/10041_编写文档.md?t=1555326144859) + * [接口交互详解](files/10050_接口交互详解.md?t=1555326144859) + * [easyopen支持](files/10070_easyopen支持.md?t=1555326144860) + * [使用签名校验工具](files/10080_使用签名校验工具.md?t=1555326144860) + * [ISV管理](files/10085_ISV管理.md?t=1555326144860) + * [路由授权](files/10090_路由授权.md?t=1555326144860) + * [SDK开发](files/10095_SDK开发.md?t=1555326144860) + * [使用SpringCloudGateway](files/10096_使用SpringCloudGateway.md?t=1555326144860) * 原理分析 - * [原理分析之@ApiMapping](files/90010_原理分析之@ApiMapping.md?t=1554693919597) - * [原理分析之路由存储](files/90011_原理分析之路由存储.md?t=1554693919597) - * [原理分析之如何路由](files/90012_原理分析之如何路由.md?t=1554693919597) + * [原理分析之@ApiMapping](files/90010_原理分析之@ApiMapping.md?t=1555326144861) + * [原理分析之路由存储](files/90011_原理分析之路由存储.md?t=1555326144861) + * [原理分析之如何路由](files/90012_原理分析之如何路由.md?t=1555326144861) + * [原理分析之文档归纳](files/90013_原理分析之文档归纳.md?t=1555326144861) diff --git a/doc/docs/files/10041_编写文档.md b/doc/docs/files/10041_编写文档.md new file mode 100644 index 00000000..f8822733 --- /dev/null +++ b/doc/docs/files/10041_编写文档.md @@ -0,0 +1,119 @@ +# 编写文档 + +作为开放平台,必须要提供文档API。 + +SOP采用微服务架构实现,因此文档应该由各个微服务各自实现。难点就是如何统一归纳各个微服务端提供的文档信息,并且统一展示。 + +写完接口后使用swagger注解来定义自己的文档信息。步骤如下: + +- maven添加swagger + +```xml + + io.springfox + springfox-swagger2 + 2.9.2 + + + io.swagger + swagger-models + + + + + io.swagger + swagger-models + 1.5.21 + + + io.springfox + springfox-swagger-ui + 2.9.2 + + +``` + +- 在config中添加swagger配置 + +```java +@Configuration +public class OpenServiceConfig extends AlipayServiceConfiguration { + // 开启文档 + @Configuration + @EnableSwagger2 + public static class Swagger2 extends SwaggerSupport { + @Override + protected String getDocTitle() { + // 不能重复。比如订单服务返回:`订单API`;库存服务返回:`库存API` + return "图书API"; + } + } +} +``` + +其中`getDocTitle()`返回文档模块名,不能和其它微服务重复。比如订单服务返回:`订单API`;库存服务返回:`库存API` + +- 编写swagger注解 + +分别在请求参数和返回结果类中编写`@ApiModelProperty` + +```java +// 请求参数 +@Data +public class BookParam { + @ApiModelProperty(value = "图书id", example = "1") + private int id; + + @ApiModelProperty(value = "图书ISBN", example = "xxxx") + private String isbn; +} + +// 返回结果 +@Data +public class BookVO { + @ApiModelProperty(value = "图书id", example = "1") + private int id; + + @ApiModelProperty(value = "图书名称", example = "白雪公主") + private String name; + + @ApiModelProperty(value = "isbn", example = "xxxxxx") + private String isbn; +} +``` + +- 在接口方法上编写`@ApiOperation`注解 + +```java +@ApiOperation(value="查询书本信息", notes = "可以根据ISBN查询书本信息") +@ApiMapping(value = "book.search") +public BookVO searchBook(BookParam param) { + BookVO bookVO = new BookVO(); + bookVO.setId(1); + bookVO.setName("白雪公主,ISBN:" + param.getIsbn()); + bookVO.setIsbn("ABCSSSSDDD"); + return bookVO; +} +``` + +其中`value`属性填接口名称,简明扼要。`notes`填写接口的详细信息,介绍,用途,注意事项等。 + +## 查看文档 + +- 启动website-server(运行WebsiteServerApplication.java) +- 找到sop-website/website-front/pages/doc/doc.html,IDEA下右键--Debug + +如果没有IDEA可以下个webstorm,同样有本地静态服务器功能。 + +效果图如下 + +![预览](images/10041_1.png "10041_1.png") + +## 注解对应关系 + +swagger注解和文档界面显示关系如下图所示: + +![预览](images/10041_2.png "10041_2.png") + + +![预览](images/10041_3.png "10041_3.png") \ No newline at end of file diff --git a/doc/docs/files/10060_使用SpringCloudGateway.md b/doc/docs/files/10096_使用SpringCloudGateway.md similarity index 100% rename from doc/docs/files/10060_使用SpringCloudGateway.md rename to doc/docs/files/10096_使用SpringCloudGateway.md diff --git a/doc/docs/files/90013_原理分析之文档归纳.md b/doc/docs/files/90013_原理分析之文档归纳.md new file mode 100644 index 00000000..a96edf94 --- /dev/null +++ b/doc/docs/files/90013_原理分析之文档归纳.md @@ -0,0 +1,19 @@ +# 原理分析之文档归纳 + +作为开放平台,必须要提供文档API。 + +SOP采用微服务架构实现,因此文档应该由各个微服务各自实现。难点是如何归纳各个微服务端提供的文档信息,并统一展示。 + +SOP的解决思路如下: + +- 各微服务使用swagger定义自己的接口信息 +- sop-website项目在启动时向注册中心获取所有服务实例,分别调用各个服务提供的swagger文档信息,保存到本地 +- sop-website前端页面负责展示swagger提供的文档信息 + +由于注册中心的存在,可以很方便的获取每个微服务提供的接口,因此可以获取到swagger提供的文档信息。 + +如此一来的好处是,各微服务不用关心文档改怎么展示,只需要写好swagger注解即可;文档信息展示统一交给另外一个工程来维护,各司其职。 + +SOP设计初衷亦是如此,微服务只管写业务代码,其它的都交给SOP来处理。 + + diff --git a/doc/docs/files/images/10041_1.png b/doc/docs/files/images/10041_1.png new file mode 100644 index 00000000..406a760e Binary files /dev/null and b/doc/docs/files/images/10041_1.png differ diff --git a/doc/docs/files/images/10041_2.png b/doc/docs/files/images/10041_2.png new file mode 100644 index 00000000..5bb443bf Binary files /dev/null and b/doc/docs/files/images/10041_2.png differ diff --git a/doc/docs/files/images/10041_3.png b/doc/docs/files/images/10041_3.png new file mode 100644 index 00000000..7dffd9b7 Binary files /dev/null and b/doc/docs/files/images/10041_3.png differ diff --git a/sop-example/sop-book/sop-book-api/src/main/java/com/hhdd/book/api/domain/Book.java b/sop-example/sop-book/sop-book-api/src/main/java/com/gitee/book/api/domain/Book.java similarity index 77% rename from sop-example/sop-book/sop-book-api/src/main/java/com/hhdd/book/api/domain/Book.java rename to sop-example/sop-book/sop-book-api/src/main/java/com/gitee/book/api/domain/Book.java index b09d939a..a286924a 100644 --- a/sop-example/sop-book/sop-book-api/src/main/java/com/hhdd/book/api/domain/Book.java +++ b/sop-example/sop-book/sop-book-api/src/main/java/com/gitee/book/api/domain/Book.java @@ -1,4 +1,4 @@ -package com.hhdd.book.api.domain; +package com.gitee.book.api.domain; import lombok.Data; diff --git a/sop-example/sop-book/sop-book-api/src/main/java/com/hhdd/book/api/service/BookService.java b/sop-example/sop-book/sop-book-api/src/main/java/com/gitee/book/api/service/BookService.java similarity index 90% rename from sop-example/sop-book/sop-book-api/src/main/java/com/hhdd/book/api/service/BookService.java rename to sop-example/sop-book/sop-book-api/src/main/java/com/gitee/book/api/service/BookService.java index 1076be9d..66d5d90e 100644 --- a/sop-example/sop-book/sop-book-api/src/main/java/com/hhdd/book/api/service/BookService.java +++ b/sop-example/sop-book/sop-book-api/src/main/java/com/gitee/book/api/service/BookService.java @@ -1,4 +1,4 @@ -package com.hhdd.book.api.service; +package com.gitee.book.api.service; import com.gitee.book.api.domain.Book; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/sop-example/sop-book/sop-book-web/pom.xml b/sop-example/sop-book/sop-book-web/pom.xml index 3bb4ca51..4e8a70a5 100644 --- a/sop-example/sop-book/sop-book-web/pom.xml +++ b/sop-example/sop-book/sop-book-web/pom.xml @@ -44,6 +44,29 @@ spring-cloud-starter-openfeign + + + io.springfox + springfox-swagger2 + 2.9.2 + + + io.swagger + swagger-models + + + + + io.swagger + swagger-models + 1.5.21 + + + io.springfox + springfox-swagger-ui + 2.9.2 + + org.springframework.boot spring-boot-starter-test diff --git a/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/config/OpenServiceConfig.java b/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/config/OpenServiceConfig.java index 21018635..9f201238 100644 --- a/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/config/OpenServiceConfig.java +++ b/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/config/OpenServiceConfig.java @@ -1,7 +1,9 @@ package com.gitee.sop.bookweb.config; import com.gitee.sop.servercommon.configuration.AlipayServiceConfiguration; +import com.gitee.sop.servercommon.swagger.SwaggerSupport; import org.springframework.context.annotation.Configuration; +import springfox.documentation.swagger2.annotations.EnableSwagger2; /** * 使用支付宝开放平台功能 @@ -9,7 +11,15 @@ import org.springframework.context.annotation.Configuration; */ @Configuration public class OpenServiceConfig extends AlipayServiceConfiguration { - + // 开启文档 + @Configuration + @EnableSwagger2 + public static class Swagger2 extends SwaggerSupport { + @Override + protected String getDocTitle() { + return "图书API"; + } + } } /** diff --git a/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/AlipayBookController.java b/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/AlipayBookController.java index 814daf9a..828581ec 100644 --- a/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/AlipayBookController.java +++ b/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/AlipayBookController.java @@ -1,15 +1,18 @@ package com.gitee.sop.bookweb.controller; +import com.gitee.book.api.domain.Book; import com.gitee.sop.bookweb.consumer.StoryServiceConsumer; +import com.gitee.sop.bookweb.param.BookParam; +import com.gitee.sop.bookweb.vo.BookVO; import com.gitee.sop.servercommon.annotation.ApiMapping; import com.gitee.sop.story.api.domain.Story; +import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RestController; import java.util.Arrays; /** - * 支付宝服务端,假设签名验证通过后,到达这里进行具体的业务处理。 * 这里演示如何接受业务参数。 * @author tanghc */ @@ -19,9 +22,19 @@ public class AlipayBookController { @Autowired StoryServiceConsumer storyServiceConsumer; + @ApiOperation(value="查询书本信息", notes = "可以根据ISBN查询书本信息") + @ApiMapping(value = "book.search") + public BookVO searchBook(BookParam param) { + BookVO bookVO = new BookVO(); + bookVO.setId(1); + bookVO.setName("白雪公主,ISBN:" + param.getIsbn()); + bookVO.setIsbn("ABCSSSSDDD"); + return bookVO; + } + @ApiMapping(value = "alipay.book.get") - public Story getBook() { - Story story = new Story(); + public Book getBook() { + Book story = new Book(); story.setId(1); story.setName("白雪公主(alipay.book.get)"); return story; diff --git a/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/BookController.java b/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/BookController.java index bde5634e..710db1a5 100644 --- a/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/BookController.java +++ b/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/BookController.java @@ -4,7 +4,7 @@ import com.gitee.book.api.domain.Book; import com.gitee.sop.bookweb.consumer.StoryServiceConsumer; import com.gitee.sop.bookweb.param.BookParam; import com.gitee.sop.story.api.domain.Story; -import com.hhdd.book.api.service.BookService; +import com.gitee.book.api.service.BookService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/param/BookParam.java b/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/param/BookParam.java index 47703b09..14841d9d 100644 --- a/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/param/BookParam.java +++ b/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/param/BookParam.java @@ -1,5 +1,6 @@ package com.gitee.sop.bookweb.param; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** @@ -7,5 +8,9 @@ import lombok.Data; */ @Data public class BookParam { + @ApiModelProperty(value = "图书id", example = "1") private int id; + + @ApiModelProperty(value = "图书ISBN", example = "xxxx") + private String isbn; } diff --git a/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/vo/BookVO.java b/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/vo/BookVO.java new file mode 100644 index 00000000..8ae601b5 --- /dev/null +++ b/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/vo/BookVO.java @@ -0,0 +1,16 @@ +package com.gitee.sop.bookweb.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class BookVO { + @ApiModelProperty(value = "图书id", example = "1") + private int id; + + @ApiModelProperty(value = "图书名称", example = "白雪公主") + private String name; + + @ApiModelProperty(value = "isbn", example = "xxxxxx") + private String isbn; +} diff --git a/sop-example/sop-story/sop-story-web/pom.xml b/sop-example/sop-story/sop-story-web/pom.xml index 5561a64a..bd7e03c5 100644 --- a/sop-example/sop-story/sop-story-web/pom.xml +++ b/sop-example/sop-story/sop-story-web/pom.xml @@ -17,7 +17,6 @@ 1.8 Greenwich.RELEASE - 2.9.2 @@ -44,7 +43,7 @@ io.springfox springfox-swagger2 - ${swagger.version} + 2.9.2 io.swagger @@ -60,7 +59,7 @@ io.springfox springfox-swagger-ui - ${swagger.version} + 2.9.2 diff --git a/sop-website/readme.md b/sop-website/readme.md new file mode 100644 index 00000000..5e67d6ff --- /dev/null +++ b/sop-website/readme.md @@ -0,0 +1,14 @@ +# 开放平台网站 + +包括文档功能,用户注册等,具体业务需要自己实现。 + +前后端分离 + +- website-front: 前端页面 +- website-server: 后台接口 + +## 使用方式 + +- 确保注册中心、网关、微服务正常启动 +- 启动website-server(运行WebsiteServerApplication.java) +- 找到sop-website/website-front/pages/doc/doc.html,IDEA下右键--Debug \ No newline at end of file diff --git a/sop-website/website-front/pages/doc/code.html b/sop-website/website-front/pages/doc/code.html new file mode 100644 index 00000000..37c3a3f4 --- /dev/null +++ b/sop-website/website-front/pages/doc/code.html @@ -0,0 +1,647 @@ + + + + + 返回状态码 + + + + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+ +
+
+
+ 公共错误码 +
+
+
+

网关会对开发者的接口非业务调用错误做统一处理,返回码如下:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
code(返回码)
+
+
msg(返回码描述)
+
+
sub_code(明细返回码)
+
+
sub_msg(明细返回码描述)
+
+
解决方案
+
+
10000
+
+
Success(接口调用成功)
+
+
 
+
+
 
+
+
 
+
+
20000
+
+
服务不可用
+
+
isp.unknow-error
+
+
服务暂不可用(业务系统不可用)
+
+
稍后重试
+
+
aop.unknow-error
+
+
服务暂不可用(网关自身的未知错误)
+
+
稍后重试
+
+
isp.service-not-available
+
+
服务暂不可用
+
+
稍后重试
+
+
20001
+
+
授权权限不足
+
+
aop.invalid-auth-token
+
+
无效的访问令牌
+
+
请刷新授权令牌或重新授权获取新的令牌
+
+
aop.auth-token-time-out
+
+
访问令牌已过期
+
+
请刷新授权令牌或重新授权获取新的令牌
+
+
aop.invalid-app-auth-token
+
+
无效的应用授权令牌
+
+
请刷新应用授权令牌或重新授权获取新的令牌
+
+
aop.invalid-app-auth-token-no-api
+
+
商户未授权当前接口
+
+
请重新授权获取新的应用授权令牌
+
+
aop.app-auth-token-time-out
+
+
应用授权令牌已过期
+
+
请刷新应用授权令牌或重新授权获取新的令牌
+
+
aop.no-product-reg-by-partner
+
+
商户未签约任何产品
+
+
ISV代理调用的场景,请上线商户的服务窗
+
+
40001
+
+
缺少必选参数
+
+
isv.missing-method
+
+
缺少方法名参数
+
+
请求参数里面必须要有method参数
+
+
isv.missing-signature
+
+
缺少签名参数
+
+
检查请求参数,缺少sign参数
+
+
isv.missing-signature-type
+
+
缺少签名类型参数
+
+
检查请求参数,缺少sign_type参数
+
+
isv.missing-signature-key
+
+
缺少签名配置
+
+
未上传公钥配置
+
+
isv.missing-app-id
+
+
缺少appId参数
+
+
检查请求参数,缺少app_id参数
+
+
isv.missing-timestamp
+
+
缺少时间戳参数
+
+
检查请求参数,缺少timestamp参数
+
+
isv.missing-version
+
+
缺少版本参数
+
+
检查请求参数,缺少version参数
+
+
isv.decryption-error-missing-encrypt-type
+
+
解密出错, 未指定加密算法
+
+
检查参数,缺少encrypt_type参数
+
+
40002
+
+
非法的参数
+
+
isv.invalid-parameter
+
+
参数无效
+
+
检查参数,格式不对、非法值、越界等
+
+
isv.upload-fail
+
+
文件上传失败
+
+
文件写入失败,重试
+
+
isv.invalid-file-extension
+
+
文件扩展名无效
+
+
检查传入的文件扩展名称,目前支持格式:csv,txt,zip,rar,gz,doc,docx,xls,xlsx,pdf,bmp,gif,jpg,jpeg,png
+
+
isv.invalid-file-size
+
+
文件大小无效
+
+
检查文件大小,目前支持最大为:50MB 
+
+
isv.invalid-method
+
+
不存在的方法名
+
+
检查入参method是否正确
+
+
isv.invalid-format
+
+
无效的数据格式
+
+
检查入参format,目前只支持json和xml 2种格式
+
+
isv.invalid-signature-type
+
+
无效的签名类型
+
+
检查入参sign_type,目前只支持RSA,RSA2,HMAC_SHA1
+
+
isv.invalid-signature
+
+
无效签名
+
+
1.公私钥是否是一对 2.检查公钥上传是否与私钥匹配 3.存在中文需要做urlencode 4.签名算法是否无误 +
+
+
isv.invalid-encrypt-type
+
+
无效的加密类型
+
+
检查入参encrypt_type,目前只支持AES
+
+
isv.invalid-encrypt
+
+
解密异常
+
+
重试
+
+
isv.invalid-app-id
+
+
无效的appId参数
+
+
检查入参app_id,app_id不存在,或者未上线
+
+
isv.invalid-timestamp
+
+
非法的时间戳参数
+
+
时间戳参数timestamp非法,请检查格式需要为"yyyy-MM-dd HH:mm:ss"
+
+
isv.invalid-charset
+
+
字符集错误
+
+
请求参数charset错误,目前支持格式:GBK,UTF-8
+
+
isv.invalid-digest
+
+
摘要错误
+
+
检查请求参数,文件摘要参数必填
+
+
isv.decryption-error-not-valid-encrypt-type
+
+
解密出错,不支持的加密算法
+
+
检查入参encrypt_type,目前只支持AES
+
+
isv.decryption-error-not-valid-encrypt-key
+
+
解密出错, 未配置加密密钥或加密密钥格式错误
+
+
没有配置加密密钥
+
+
isv.decryption-error-unknown
+
+
解密出错,未知异常
+
+
重试
+
+
isv.missing-signature-config
+
+
验签出错, 未配置对应签名算法的公钥或者证书
+
+
没有配置应用公钥
+
+
isv.not-support-app-auth
+
+
本接口不支持第三方代理调用
+
+
本接口不支持第三方代理调用
+
+
isv.suspected-attack
+
+
可疑的攻击请求
+
+
+
40004
+
+
业务处理失败
+
+
对应业务错误码,明细错误码和解决方案请参见具体的API接口文档
+
+
40006
+
+
权限不足
+
+
isv.insufficient-isv-permissions
+
+
ISV权限不足
+
+
请检查配置的账户是否有当前接口权限
+
+
isv.insufficient-user-permissions
+
+
用户权限不足
+
+
代理的商户没有当前接口权限
+
+
isv.route-no-permissions
+
+
用户权限不足
+
+
没有当前接口权限
+
+
isv.access-forbidden
+
+
用户权限不足
+
+
无权访问(接口被禁用)
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/sop-website/website-front/pages/doc/doc.html b/sop-website/website-front/pages/doc/doc.html index 04764510..3c1e6e55 100644 --- a/sop-website/website-front/pages/doc/doc.html +++ b/sop-website/website-front/pages/doc/doc.html @@ -2,7 +2,7 @@ - 滑块文档 - layui + 文档中心 @@ -12,15 +12,9 @@ - - - - - - + + + +
+ +
+ + +
+
+ +
+ +
+ +
+

如果未使用开放平台SDK,需要自行实现签名过程。

+ +
+ 如何签名 +
+

1.筛选并排序

+

+ 获取所有请求参数,不包括字节类型参数,如文件、字节流,剔除sign字段,剔除值为空的参数,并按照第一个字符的键值ASCII码递增排序(字母升序排序),如果遇到相同字符则按照第二个字符的键值ASCII码递增排序,以此类推。

+

2.拼接

+

将排序后的参数与其对应值,组合成“参数=参数值”的格式,并且把这些参数用&字符连接起来,此时生成的字符串为待签名字符串。

+

例如下面的请求示例,参数值都是示例,开发者参考格式即可:

+
REQUEST URL: http://open-test.yourdomain.com/api
+REQUEST METHOD: POST
+CONTENT:
+app_id=2014072300007148
+method=alipay.mobile.public.menu.add
+charset=GBK
+sign_type=RSA2
+timestamp=2014-07-24 03:07:50
+biz_content={"button":[{"actionParam":"ZFB_HFCZ","actionType":"out","name":"话费充值"},{"name":"查询","subButton":[{"actionParam":"ZFB_YECX","actionType":"out","name":"余额查询"},{"actionParam":"ZFB_LLCX","actionType":"out","name":"流量查询"},{"actionParam":"ZFB_HFCX","actionType":"out","name":"话费查询"}]},{"actionParam":"http://m.alipay.com","actionType":"link","name":"最新优惠"}]}
+sign=e9zEAe4TTQ4LPLQvETPoLGXTiURcxiAKfMVQ6Hrrsx2hmyIEGvSfAQzbLxHrhyZ48wOJXTsD4FPnt+YGdK57+fP1BCbf9rIVycfjhYCqlFhbTu9pFnZgT55W+xbAFb9y7vL0MyAxwXUXvZtQVqEwW7pURtKilbcBTEW7TAxzgro=
+version=1.0
+
+

则待签名字符串为:

+
app_id=2014072300007148&biz_content={"button":[{"actionParam":"ZFB_HFCZ","actionType":"out","name":"话费充值"},{"name":"查询","subButton":[{"actionParam":"ZFB_YECX","actionType":"out","name":"余额查询"},{"actionParam":"ZFB_LLCX","actionType":"out","name":"流量查询"},{"actionParam":"ZFB_HFCX","actionType":"out","name":"话费查询"}]},{"actionParam":"http://m.alipay.com","actionType":"link","name":"最新优惠"}]}&charset=GBK&method=alipay.mobile.public.menu.add&sign_type=RSA2&timestamp=2014-07-24 03:07:50&version=1.0
+

3.调用签名函数

+

+ 使用各自语言对应的SHA256WithRSA(对应sign_type为RSA2)或SHA1WithRSA(对应sign_type为RSA)签名函数利用商户私钥对待签名字符串进行签名,并进行Base64编码。

+

4.把生成的签名赋值给sign参数,拼接到请求参数中。

+
/**
+@param content 加签内容
+@param privateKey 加签私钥
+@param charset 加签字符集
+@param charset 签名方法
+**/
+String AlipaySignature.rsaSign(String content, String privateKey, String charset,String signType)
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/sop-website/website-server/src/main/java/com/gitee/sop/websiteserver/bean/DocParameter.java b/sop-website/website-server/src/main/java/com/gitee/sop/websiteserver/bean/DocParameter.java index 79c81a5b..17a6c10b 100644 --- a/sop-website/website-server/src/main/java/com/gitee/sop/websiteserver/bean/DocParameter.java +++ b/sop-website/website-server/src/main/java/com/gitee/sop/websiteserver/bean/DocParameter.java @@ -1,5 +1,6 @@ package com.gitee.sop.websiteserver.bean; +import com.alibaba.fastjson.annotation.JSONField; import lombok.Data; /** @@ -14,4 +15,7 @@ public class DocParameter { private String description; private String example = ""; + @JSONField(name = "x-example") + private String x_example = ""; + } diff --git a/sop-website/website-server/src/main/java/com/gitee/sop/websiteserver/controller/DocController.java b/sop-website/website-server/src/main/java/com/gitee/sop/websiteserver/controller/DocController.java index a50f25d2..e12b6826 100644 --- a/sop-website/website-server/src/main/java/com/gitee/sop/websiteserver/controller/DocController.java +++ b/sop-website/website-server/src/main/java/com/gitee/sop/websiteserver/controller/DocController.java @@ -5,6 +5,7 @@ import com.gitee.sop.websiteserver.bean.DocModule; import com.gitee.sop.websiteserver.manager.DocManager; import com.gitee.sop.websiteserver.vo.DocBaseInfoVO; import com.gitee.sop.websiteserver.vo.DocModuleVO; +import org.apache.commons.lang.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -32,6 +33,9 @@ public class DocController { @Value("${api.url-prod}") String urlProd; + @Value("${api.pwd}") + String pwd; + @GetMapping("/getDocBaseInfo") public DocBaseInfoVO getDocBaseInfo() { List docModuleVOList = docManager.listAll() @@ -60,4 +64,11 @@ public class DocController { return docManager.get(method, version); } + + @GetMapping("/doc/reload") + public void reload(String pwd) { + if (StringUtils.equals(this.pwd, pwd)) { + docManager.load(); + } + } } diff --git a/sop-website/website-server/src/main/java/com/gitee/sop/websiteserver/manager/DocManagerImpl.java b/sop-website/website-server/src/main/java/com/gitee/sop/websiteserver/manager/DocManagerImpl.java index cded89d8..57e83152 100644 --- a/sop-website/website-server/src/main/java/com/gitee/sop/websiteserver/manager/DocManagerImpl.java +++ b/sop-website/website-server/src/main/java/com/gitee/sop/websiteserver/manager/DocManagerImpl.java @@ -3,8 +3,8 @@ package com.gitee.sop.websiteserver.manager; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.gitee.sop.websiteserver.bean.DocModule; import com.gitee.sop.websiteserver.bean.DocItem; +import com.gitee.sop.websiteserver.bean.DocModule; import com.gitee.sop.websiteserver.bean.DocParameter; import com.gitee.sop.websiteserver.bean.EurekaApplication; import com.gitee.sop.websiteserver.bean.EurekaApps; @@ -20,6 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.env.Environment; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; +import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestTemplate; import javax.annotation.PostConstruct; @@ -61,6 +62,7 @@ public class DocManagerImpl implements DocManager { public void load() { try { Map> listMap = this.getAllServiceList(); + log.info("服务列表:{}", JSON.toJSONString(listMap.keySet())); // {"STORY-SERVICE":[{"ipAddr":"10.1.30.54","name":"STORY-SERVICE","serverPort":"2222"}],"API-GATEWAY":[{"ipAddr":"10.1.30.54","name":"API-GATEWAY","serverPort":"8081"}]} for (Map.Entry> entry : listMap.entrySet()) { ServiceInfoVO serviceInfoVo = entry.getValue().get(0); @@ -79,10 +81,16 @@ public class DocManagerImpl implements DocManager { private void loadDocInfo(ServiceInfoVO serviceInfoVo) { String url = "http://" + serviceInfoVo.getIpAddr() + ":" + serviceInfoVo.getServerPort() + "/v2/api-docs"; - ResponseEntity entity = restTemplate.getForEntity(url, String.class); - String docInfoJson = entity.getBody(); - DocModule docDefinition = this.parseDocJson(docInfoJson); - docDefinitionMap.put(docDefinition.getModule(), docDefinition); + try { + ResponseEntity entity = restTemplate.getForEntity(url, String.class); + String docInfoJson = entity.getBody(); + DocModule docDefinition = this.parseDocJson(docInfoJson); + docDefinitionMap.put(docDefinition.getModule(), docDefinition); + } catch (RestClientException e) { + // 这里报错可能是因为有些微服务没有配置swagger文档,导致404访问不到 + // 这里catch跳过即可 + log.warn("读取文档失败, url:{}", url, e); + } } private DocModule parseDocJson(String docInfoJson) { diff --git a/sop-website/website-server/src/main/resources/application-dev.yml b/sop-website/website-server/src/main/resources/application-dev.yml index b4f3eac8..b6e0b7e0 100644 --- a/sop-website/website-server/src/main/resources/application-dev.yml +++ b/sop-website/website-server/src/main/resources/application-dev.yml @@ -20,4 +20,5 @@ api: # 测试地址 url-test: http://api-test.yourdomain.com/api # 正式地址 - url-prod: http://api.yourdomain.com/api \ No newline at end of file + url-prod: http://open.yourdomain.com/api + pwd: doc#123 \ No newline at end of file diff --git a/sop.sql b/sop.sql index 79d8987c..b4dc8dde 100644 --- a/sop.sql +++ b/sop.sql @@ -1,3 +1,10 @@ +# +# SQL Export +# Created by Querious (201048) +# Created: 2019年4月15日 GMT+8 下午8:09:15 +# Encoding: Unicode (UTF-8) +# + CREATE DATABASE IF NOT EXISTS `sop` DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci; USE `sop`; @@ -13,6 +20,49 @@ DROP TABLE IF EXISTS `perm_role_permission`; DROP TABLE IF EXISTS `perm_role`; DROP TABLE IF EXISTS `perm_isv_role`; DROP TABLE IF EXISTS `isv_info`; +DROP TABLE IF EXISTS `config_route_limit`; +DROP TABLE IF EXISTS `config_route_base`; +DROP TABLE IF EXISTS `admin_user_info`; + + +CREATE TABLE `admin_user_info` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `username` varchar(64) NOT NULL DEFAULT '' COMMENT '用户名', + `password` varchar(128) NOT NULL DEFAULT '' COMMENT '密码', + `status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态,1:启用,2:禁用', + `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `uk_username` (`username`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='后台用户表'; + + +CREATE TABLE `config_route_base` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `route_id` varchar(64) NOT NULL DEFAULT '' COMMENT '路由id', + `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态,1:启用,2:禁用', + `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `uk_routeid` (`route_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='路由配置表'; + + +CREATE TABLE `config_route_limit` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `route_id` varchar(64) NOT NULL COMMENT '路由id', + `service_id` varchar(64) NOT NULL DEFAULT '', + `limit_type` tinyint(4) NOT NULL DEFAULT '1' COMMENT '限流策略,1:漏桶策略,2:令牌桶策略', + `exec_count_per_second` int(11) DEFAULT NULL COMMENT '每秒可处理请求数', + `limit_code` varchar(20) DEFAULT NULL COMMENT '返回的错误码', + `limit_msg` varchar(100) DEFAULT NULL COMMENT '返回的错误信息', + `token_bucket_count` int(11) DEFAULT NULL COMMENT '令牌桶容量', + `limit_status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '限流开启状态,1:开启,0关闭', + `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, + `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `uk_routeid` (`route_id`) USING BTREE +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='路由限流配置'; CREATE TABLE `isv_info` ( @@ -26,7 +76,7 @@ CREATE TABLE `isv_info` ( `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `uk_app_key` (`app_key`) -) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='isv信息表'; +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COMMENT='isv信息表'; CREATE TABLE `perm_isv_role` ( @@ -37,7 +87,7 @@ CREATE TABLE `perm_isv_role` ( `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `uk_user_role` (`isv_id`,`role_code`) -) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8 COMMENT='isv角色'; +) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8 COMMENT='isv角色'; CREATE TABLE `perm_role` ( @@ -59,21 +109,9 @@ CREATE TABLE `perm_role_permission` ( `gmt_modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`), UNIQUE KEY `uk_role_perm` (`role_code`,`route_id`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COMMENT='角色权限表'; - -DROP TABLE IF EXISTS `admin_user_info`; +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COMMENT='角色权限表'; -CREATE TABLE `admin_user_info` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, - `username` varchar(64) NOT NULL DEFAULT '' COMMENT '用户名', - `password` varchar(128) NOT NULL DEFAULT '' COMMENT '密码', - `status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态,1:启用,2:禁用', - `gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, - `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`id`), - UNIQUE KEY `uk_username` (`username`) USING BTREE -) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='后台用户表'; SET FOREIGN_KEY_CHECKS = @PREVIOUS_FOREIGN_KEY_CHECKS; @@ -83,15 +121,44 @@ SET @PREVIOUS_FOREIGN_KEY_CHECKS = @@FOREIGN_KEY_CHECKS; SET FOREIGN_KEY_CHECKS = 0; +LOCK TABLES `admin_user_info` WRITE; +ALTER TABLE `admin_user_info` DISABLE KEYS; +INSERT INTO `admin_user_info` (`id`, `username`, `password`, `status`, `gmt_create`, `gmt_modified`) VALUES + (1,'admin','14e1b600b1fd579f47433b88e8d85291',1,'2019-04-02 19:55:26','2019-04-02 19:55:26'); +ALTER TABLE `admin_user_info` ENABLE KEYS; +UNLOCK TABLES; + + +LOCK TABLES `config_route_base` WRITE; +ALTER TABLE `config_route_base` DISABLE KEYS; +INSERT INTO `config_route_base` (`id`, `route_id`, `status`, `gmt_create`, `gmt_modified`) VALUES + (1,'story.get1.1',1,'2019-04-09 19:15:58','2019-04-09 19:16:54'), + (2,'alipay.story.get1.0',1,'2019-04-09 19:19:57','2019-04-11 09:35:26'), + (3,'alipay.story.find1.0',1,'2019-04-11 09:29:55','2019-04-11 09:35:02'); +ALTER TABLE `config_route_base` ENABLE KEYS; +UNLOCK TABLES; + + +LOCK TABLES `config_route_limit` WRITE; +ALTER TABLE `config_route_limit` DISABLE KEYS; +INSERT INTO `config_route_limit` (`id`, `route_id`, `service_id`, `limit_type`, `exec_count_per_second`, `limit_code`, `limit_msg`, `token_bucket_count`, `limit_status`, `gmt_create`, `gmt_modified`) VALUES + (1,'alipay.story.find1.0','story-service',1,10,'isp.service-busy','服务器正忙',NULL,1,'2019-04-10 20:55:08','2019-04-10 21:04:35'), + (2,'alipay.story.get1.0','story-service',2,5,'isp.service-busy','服务器正忙',5,0,'2019-04-10 21:05:51','2019-04-11 18:18:03'), + (3,'alipay.story.get1.2','story-service',2,10,'isp.service-busy','服务器正忙',3,1,'2019-04-11 17:26:04','2019-04-11 18:19:33'); +ALTER TABLE `config_route_limit` ENABLE KEYS; +UNLOCK TABLES; + + LOCK TABLES `isv_info` WRITE; ALTER TABLE `isv_info` DISABLE KEYS; INSERT INTO `isv_info` (`id`, `app_key`, `secret`, `pub_key`, `pri_key`, `status`, `gmt_create`, `gmt_modified`) VALUES (1,'2019032617262200001','','MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlyb9aUBaljQP/vjmBFe1mF8HsWSvyfC2NTlpT/V9E+sBxTr8TSkbzJCeeeOEm4LCaVXL0Qz63MZoT24v7AIXTuMdj4jyiM/WJ4tjrWAgnmohNOegfntTto16C3l234vXz4ryWZMR/7W+MXy5B92wPGQEJ0LKFwNEoLspDEWZ7RdE53VH7w6y6sIZUfK+YkXWSwehfKPKlx+lDw3zRJ3/yvMF+U+BAdW/MfECe1GuBnCFKnlMRh3UKczWyXWkL6ItOpYHHJi/jx85op5BWDje2pY9QowzfN94+0DB3T7UvZeweu3zlP6diwAJDzLaFQX8ULfWhY+wfKxIRgs9NoiSAQIDAQAB','MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCXJv1pQFqWNA/++OYEV7WYXwexZK/J8LY1OWlP9X0T6wHFOvxNKRvMkJ5544SbgsJpVcvRDPrcxmhPbi/sAhdO4x2PiPKIz9Yni2OtYCCeaiE056B+e1O2jXoLeXbfi9fPivJZkxH/tb4xfLkH3bA8ZAQnQsoXA0SguykMRZntF0TndUfvDrLqwhlR8r5iRdZLB6F8o8qXH6UPDfNEnf/K8wX5T4EB1b8x8QJ7Ua4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r7CPlTKAWTRYMJxCT1Hi5gwJb+CZF3+IeYqsJk2NF2s0w5WJTE70k1BSvQsfIzAIDz2yE1oPHvwVAoGAA6e+xQkVH4fMEph55RJIZ5goI4Y76BSvt2N5OKZKd4HtaV+eIhM3SDsVYRLIm9ZquJHMiZQGyUGnsvrKL6AAVNK7eQZCRDk9KQz+0GKOGqku0nOZjUbAu6A2/vtXAaAuFSFx1rUQVVjFulLexkXR3KcztL1Qu2k5pB6Si0K/uwQ=',1,'2019-03-27 10:10:34','2019-04-01 20:54:01'), - (3,'asdfasdf','222','333','4444',1,'2019-03-27 11:01:11','2019-04-01 16:23:06'), + (3,'asdfasdf','','333','4444',2,'2019-03-27 11:01:11','2019-04-14 23:30:17'), (5,'20190331562013861008375808','29864b93427447f5ac6c44df746f84ef','MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC4aMIx2q8rCVu5z6dgNQQSX2vwhvIcRb7FaqSk0ZK8AV9qQeE1TvfFVlAzOHlysE1yTRb0Mb6W2aw7IAS7Bkc3onYBQR4zNQYjYoDBzLukjF8o84hoVFRnh7sV8zszid2vb5H/YQr3M+5sYhlXY8KfILk3vhdbWpHM/umplcrxlwIDAQAB','MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBALhowjHarysJW7nPp2A1BBJfa/CG8hxFvsVqpKTRkrwBX2pB4TVO98VWUDM4eXKwTXJNFvQxvpbZrDsgBLsGRzeidgFBHjM1BiNigMHMu6SMXyjziGhUVGeHuxXzOzOJ3a9vkf9hCvcz7mxiGVdjwp8guTe+F1takcz+6amVyvGXAgMBAAECgYBj40LFVGoryp7n0CYeg7kX5p4GJGKCk/jY4IIcUPTFZ4zydorxoDuvpag9hmqqh/r7XeyAC23sMi4LvLUzRRxPh+7PuwL6nLce7vytsMCZQTPpBgz7dUfbi2HAxsuMOLjH3sVGycutARJsz6bT+9PyBEuVtUqwBrDGpFvwT0z6yQJBAOANC8nysb+O4rn/fbJtHIhtQoV74y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C0My02sCWwWXLlXi8y7An+Rec73Ve0yxREOn5WrQT6pkmzh7V/ABWrYi5WxODpCIjtSbo0fLBa3Wqle00b0/hdCITetqIa/cFs1zUrOqICgK3bKWeXqiAkhhcwSZwwSgwOKM04Wn7ZUCgYBvhHX2mbdVJfyJ8kc+hMOE/E9RHRxiBVEXWHJlGi8PVCqNDq8qHr4g7Mdbzprig+s0yKblwHAvrpkseWvKHiZEjVTyDipHgShY4TGXEigVvUd37uppTrLi8xpYcJjS9gH/px7VCdiq1d+q/MJP6coJ1KphgATm2UrgDMYNBWaYWQKBgEHRxrmER7btUF60/YgcqPHFc8RpYQB2ZZE0kyKGDqk2Data1XYUY6vsPAU28yRLAaWr/D2H17iyLkxP80VLm6QhifxCadv90Q/Wl1DFfOJQMW6avyQ0so6G0wFq/LJxaFK4iLXQn1RJnmTp6BYiJMmK2BhFbRzw8ssMoF6ad2rr',1,'2019-04-03 19:54:05','2019-04-03 20:11:58'); ALTER TABLE `isv_info` ENABLE KEYS; UNLOCK TABLES; @@ -103,7 +170,8 @@ INSERT INTO `perm_isv_role` (`id`, `isv_id`, `role_code`, `gmt_create`, `gmt_mod (17,6,'vip','2019-03-31 22:07:26','2019-03-31 22:07:26'), (18,5,'normal','2019-03-31 22:07:50','2019-03-31 22:07:50'), (32,7,'normal','2019-04-01 20:27:33','2019-04-01 20:27:33'), - (33,1,'normal','2019-04-01 20:54:01','2019-04-01 20:54:01'); + (33,1,'normal','2019-04-01 20:54:01','2019-04-01 20:54:01'), + (36,9,'normal','2019-04-03 20:11:58','2019-04-03 20:11:58'); ALTER TABLE `perm_isv_role` ENABLE KEYS; UNLOCK TABLES; @@ -120,16 +188,11 @@ UNLOCK TABLES; LOCK TABLES `perm_role_permission` WRITE; ALTER TABLE `perm_role_permission` DISABLE KEYS; INSERT INTO `perm_role_permission` (`id`, `role_code`, `route_id`, `gmt_create`, `gmt_modified`) VALUES - (10,'normal','permission.story.get1.0','2019-04-01 20:54:44','2019-04-01 20:54:44'); + (11,'normal','permission.story.get1.0','2019-04-03 10:09:35','2019-04-03 10:09:35'); ALTER TABLE `perm_role_permission` ENABLE KEYS; UNLOCK TABLES; -LOCK TABLES `admin_user_info` WRITE; -ALTER TABLE `admin_user_info` DISABLE KEYS; -INSERT INTO `admin_user_info` (`id`, `username`, `password`, `status`, `gmt_create`, `gmt_modified`) VALUES - (1,'admin','14e1b600b1fd579f47433b88e8d85291',1,'2019-04-02 19:55:26','2019-04-02 19:55:26'); -ALTER TABLE `admin_user_info` ENABLE KEYS; -UNLOCK TABLES; + SET FOREIGN_KEY_CHECKS = @PREVIOUS_FOREIGN_KEY_CHECKS;