diff --git a/README.md b/README.md
index c486154d..8863de2b 100644
--- a/README.md
+++ b/README.md
@@ -61,8 +61,7 @@ SOP封装了开放平台大部分功能包括:签名验证、统一异常处
- sop-registry:注册中心,eureka实现
- sop-gateway:网关,统一访问入口,Spring Cloud Zuul实现,可切换成Spring Cloud Gateway
- sop-common:公共模块,封装常用功能,包含签名校验、错误处理等功能
-- sop-story:微服务示例,story服务,同时作为Provider提供服务
-- sop-book:微服务示例,book服务,也是Consumer,调用story提供的服务
+- sop-example:微服务示例
- sop-test:接口调用测试用例
diff --git a/doc/docs/_sidebar.md b/doc/docs/_sidebar.md
index 8389b904..2eefab8c 100644
--- a/doc/docs/_sidebar.md
+++ b/doc/docs/_sidebar.md
@@ -1,13 +1,13 @@
-* [首页](/?t=1553566189196)
+* [首页](/?t=1553568114881)
* 开发文档
- * [快速体验](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)
+ * [快速体验](files/10010_快速体验.md?t=1553568114881)
+ * [项目接入到SOP](files/10011_项目接入到SOP.md?t=1553568114907)
+ * [新增接口](files/10020_新增接口.md?t=1553568114907)
+ * [业务参数校验](files/10030_业务参数校验.md?t=1553568114907)
+ * [错误处理](files/10040_错误处理.md?t=1553568114908)
+ * [接口交互详解](files/10050_接口交互详解.md?t=1553568114908)
+ * [使用SpringCloudGateway](files/10060_使用SpringCloudGateway.md?t=1553568114908)
+ * [easyopen支持](files/10070_easyopen支持.md?t=1553568114908)
* 原理分析
- * [原理分析之@ApiMapping](files/90010_原理分析之@ApiMapping.md?t=1553566189215)
- * [原理分析之路由存储](files/90011_原理分析之路由存储.md?t=1553566189215)
+ * [原理分析之@ApiMapping](files/90010_原理分析之@ApiMapping.md?t=1553568114909)
+ * [原理分析之路由存储](files/90011_原理分析之路由存储.md?t=1553568114909)
diff --git a/doc/docs/files/10070_easyopen支持.md b/doc/docs/files/10070_easyopen支持.md
index 37e3fad7..d5162433 100644
--- a/doc/docs/files/10070_easyopen支持.md
+++ b/doc/docs/files/10070_easyopen支持.md
@@ -61,3 +61,5 @@ public class ZuulConfig extends EasyopenZuulConfiguration {
配置完毕,重启网关服务,可运行测试用例`EasyopenClientPostTest.java`验证
**注:** 配置完成后easyopen签名校验将会关闭,改用网关端来校验;网关对easyopen返回的结果不进行处理,直接返回服务端的结果。
+
+完整配置可查看sop-example/sop-easyopen项目
diff --git a/pom.xml b/pom.xml
index a6afca47..e9be012a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -13,11 +13,10 @@
doc
sop-common
+ sop-example
sop-admin
sop-registry
sop-gateway
- sop-story
- sop-book
sop-test
\ No newline at end of file
diff --git a/sop-book/sop-book-api/.gitignore b/sop-book/sop-book-api/.gitignore
deleted file mode 100644
index c456c4a3..00000000
--- a/sop-book/sop-book-api/.gitignore
+++ /dev/null
@@ -1,25 +0,0 @@
-/target/
-!.mvn/wrapper/maven-wrapper.jar
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-
-### NetBeans ###
-/nbproject/private/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
-/build/
diff --git a/sop-book/sop-book-api/pom.xml b/sop-book/sop-book-api/pom.xml
deleted file mode 100644
index c47d23c4..00000000
--- a/sop-book/sop-book-api/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
- 4.0.0
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.1.2.RELEASE
-
-
- com.gitee.sop
- sop-book-api
- 1.0-SNAPSHOT
-
-
- 1.8
- Greenwich.RELEASE
-
-
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
-
- org.projectlombok
- lombok
- 1.18.4
- provided
-
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-dependencies
- ${spring-cloud.version}
- pom
- import
-
-
-
-
\ No newline at end of file
diff --git a/sop-book/sop-book-api/src/main/java/com/hhdd/book/api/domain/Book.java b/sop-book/sop-book-api/src/main/java/com/hhdd/book/api/domain/Book.java
deleted file mode 100644
index a286924a..00000000
--- a/sop-book/sop-book-api/src/main/java/com/hhdd/book/api/domain/Book.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package com.gitee.book.api.domain;
-
-import lombok.Data;
-
-/**
- * @author tanghc
- */
-@Data
-public class Book {
- private int id;
- private String name;
-}
diff --git a/sop-book/sop-book-api/src/main/java/com/hhdd/book/api/service/BookService.java b/sop-book/sop-book-api/src/main/java/com/hhdd/book/api/service/BookService.java
deleted file mode 100644
index 1076be9d..00000000
--- a/sop-book/sop-book-api/src/main/java/com/hhdd/book/api/service/BookService.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.hhdd.book.api.service;
-
-import com.gitee.book.api.domain.Book;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-
-/**
- * @author tanghc
- */
-@RequestMapping("/book")
-public interface BookService {
- @RequestMapping("/getBook")
- Book getBook(@RequestParam("id") int id);
-}
diff --git a/sop-book/sop-book-web/.gitignore b/sop-book/sop-book-web/.gitignore
deleted file mode 100644
index c456c4a3..00000000
--- a/sop-book/sop-book-web/.gitignore
+++ /dev/null
@@ -1,25 +0,0 @@
-/target/
-!.mvn/wrapper/maven-wrapper.jar
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-
-### NetBeans ###
-/nbproject/private/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
-/build/
diff --git a/sop-book/sop-book-web/pom.xml b/sop-book/sop-book-web/pom.xml
deleted file mode 100644
index 232bf99f..00000000
--- a/sop-book/sop-book-web/pom.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
- 4.0.0
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.1.2.RELEASE
-
-
- com.gitee.sop
- sop-book-web
- 0.0.1-SNAPSHOT
- sop-story
- Demo project for Spring Boot
-
-
- 1.8
- Greenwich.RELEASE
-
-
-
-
- com.gitee.sop
- sop-service-common
- 1.0.0-SNAPSHOT
-
-
- com.gitee.sop
- sop-book-api
- 1.0-SNAPSHOT
-
-
- com.gitee.sop
- sop-story-api
- 1.0-SNAPSHOT
-
-
- org.springframework.cloud
- spring-cloud-starter-netflix-eureka-client
-
-
- org.springframework.cloud
- spring-cloud-starter-openfeign
-
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
- org.projectlombok
- lombok
- 1.18.4
- compile
-
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-dependencies
- ${spring-cloud.version}
- pom
- import
-
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
-
-
-
diff --git a/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/SopBookApplication.java b/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/SopBookApplication.java
deleted file mode 100644
index cfb16be7..00000000
--- a/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/SopBookApplication.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.gitee.sop.bookweb;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
-import org.springframework.cloud.openfeign.EnableFeignClients;
-
-// 允许调用其他服务
-@EnableFeignClients
-// 服务注册
-@EnableDiscoveryClient
-@SpringBootApplication
-public class SopBookApplication {
-
- public static void main(String[] args) {
- SpringApplication.run(SopBookApplication.class, args);
- }
-
-}
-
diff --git a/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/config/OpenServiceConfig.java b/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/config/OpenServiceConfig.java
deleted file mode 100644
index 21018635..00000000
--- a/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/config/OpenServiceConfig.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.gitee.sop.bookweb.config;
-
-import com.gitee.sop.servercommon.configuration.AlipayServiceConfiguration;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * 使用支付宝开放平台功能
- * @author tanghc
- */
-@Configuration
-public class OpenServiceConfig extends AlipayServiceConfiguration {
-
-}
-
-/**
- * 使用淘宝开放平台功能
- * @author tanghc
- */
-//@Configuration
-//public class OpenServiceConfig extends TaobaoServiceConfiguration {
-//
-//}
diff --git a/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/consumer/StoryServiceConsumer.java b/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/consumer/StoryServiceConsumer.java
deleted file mode 100644
index cce5945b..00000000
--- a/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/consumer/StoryServiceConsumer.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.gitee.sop.bookweb.consumer;
-
-import com.gitee.sop.story.api.service.StoryService;
-import org.springframework.cloud.openfeign.FeignClient;
-
-/**
- * 调用story服务
- *
- * @author tanghc
- */
-// value对应的spring.application.name
-@FeignClient("story-service")
-public interface StoryServiceConsumer extends StoryService {
-}
diff --git a/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/AlipayBookController.java b/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/AlipayBookController.java
deleted file mode 100644
index 814daf9a..00000000
--- a/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/AlipayBookController.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.gitee.sop.bookweb.controller;
-
-import com.gitee.sop.bookweb.consumer.StoryServiceConsumer;
-import com.gitee.sop.servercommon.annotation.ApiMapping;
-import com.gitee.sop.story.api.domain.Story;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.Arrays;
-
-/**
- * 支付宝服务端,假设签名验证通过后,到达这里进行具体的业务处理。
- * 这里演示如何接受业务参数。
- * @author tanghc
- */
-@RestController
-public class AlipayBookController {
-
- @Autowired
- StoryServiceConsumer storyServiceConsumer;
-
- @ApiMapping(value = "alipay.book.get")
- public Story getBook() {
- Story story = new Story();
- story.setId(1);
- story.setName("白雪公主(alipay.book.get)");
- return story;
- }
-
- // 调用story服务
- @ApiMapping(value = "alipay.book.story.get")
- public Object getBook2() {
- Story story = new Story();
- story.setId(1);
- story.setName("白雪公主(alipay.book.story.get)");
- Story story2 = storyServiceConsumer.getStory(1);
- return Arrays.asList(story, story2);
- }
-
-}
diff --git a/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/ApiResult.java b/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/ApiResult.java
deleted file mode 100644
index a39434b8..00000000
--- a/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/ApiResult.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.gitee.sop.bookweb.controller;
-
-import com.thoughtworks.xstream.annotations.XStreamAlias;
-import lombok.Data;
-
-/**
- * 默认的结果封装类.
- *
- *
- * xml返回结果:
- *
- * 50
- * Remote service error
- * isv.invalid-parameter
- * 非法参数
- *
- * 成功情况:
- *
- * 0
- * 成功消息
- *
- * ...返回内容
- *
- *
- *
- * json返回格式:
- * {
- * "code":"50",
- * "msg":"Remote service error",
- * "sub_code":"isv.invalid-parameter",
- * "sub_msg":"非法参数"
- * }
- * 成功情况:
- * {
- * "code":"0",
- * "msg":"成功消息内容。。。",
- * "data":{
- * ...返回内容
- * }
- * }
- *
- *
- * 字段说明:
- * code:网关异常码
- * msg:网关异常信息
- * sub_code:业务异常码
- * sub_msg:业务异常信息
- *
- * @author tanghc
- */
-@XStreamAlias("response")
-@Data
-public class ApiResult {
-
- /**
- * 网关异常信息
- */
- private String msg;
-
- /**
- * 业务异常码
- */
- private String sub_msg;
-
- /**
- * 业务异常信息
- */
- private String sub_code;
-
- /**
- * 返回结果
- */
- private Object data;
-}
diff --git a/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/BookController.java b/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/BookController.java
deleted file mode 100644
index bde5634e..00000000
--- a/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/BookController.java
+++ /dev/null
@@ -1,73 +0,0 @@
-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.story.api.domain.Story;
-import com.hhdd.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;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.Arrays;
-
-/**
- * book服务
- *
- * @author tanghc
- */
-@RestController
-public class BookController implements BookService {
-
- @Autowired
- StoryServiceConsumer storyServiceConsumer;
-
- @Override
- public Book getBook(int id) {
- Book book = new Book();
- book.setId(id);
- book.setName("汪汪队");
- return book;
- }
-
- @RequestMapping("listBookAndStory")
- public Object listBookAndStory(int id) {
- Book book = new Book();
- book.setId(id);
- book.setName("汪汪队");
-
- // 调用story服务
- Story story = storyServiceConsumer.getStory(id);
-
- return Arrays.asList(book, story);
- }
-
- @RequestMapping("getBook2")
- public Object getBookError(int id) {
- if (id == 0) {
- throw new RuntimeException("id不能为空");
- }
- Book book = new Book();
- book.setId(id);
- book.setName("汪汪队");
- return Arrays.asList(book);
- }
-
-
-
- @RequestMapping("getBook3")
- public Object getBook3(@RequestBody BookParam param) {
- if (param.getId() == 0) {
- throw new RuntimeException("id不能为空");
- }
- Book book = new Book();
- book.setId(param.getId());
- book.setName("小马宝莉");
-
- ApiResult apiResult = new ApiResult();
- apiResult.setData(book);
- return apiResult;
- }
-
-}
diff --git a/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/param/BookParam.java b/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/param/BookParam.java
deleted file mode 100644
index 47703b09..00000000
--- a/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/param/BookParam.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package com.gitee.sop.bookweb.param;
-
-import lombok.Data;
-
-/**
- * @author tanghc
- */
-@Data
-public class BookParam {
- private int id;
-}
diff --git a/sop-book/sop-book-web/src/main/resources/application.yml b/sop-book/sop-book-web/src/main/resources/application.yml
deleted file mode 100644
index 2a74db4e..00000000
--- a/sop-book/sop-book-web/src/main/resources/application.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-server:
- port: 3333
-
-eureka:
- port: 1111
- host: localhost
- client:
- serviceUrl:
- defaultZone: http://${eureka.host}:${eureka.port}/eureka/
\ No newline at end of file
diff --git a/sop-book/sop-book-web/src/main/resources/bootstrap.yml b/sop-book/sop-book-web/src/main/resources/bootstrap.yml
deleted file mode 100644
index ca23c4f1..00000000
--- a/sop-book/sop-book-web/src/main/resources/bootstrap.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-spring:
- application:
- name: book-service
-
- cloud:
- zookeeper:
- connect-string: localhost:2181
\ No newline at end of file
diff --git a/sop-book/sop-book-web/src/test/java/com/gitee/sop/bookweb/SopBookApplicationTests.java b/sop-book/sop-book-web/src/test/java/com/gitee/sop/bookweb/SopBookApplicationTests.java
deleted file mode 100644
index 6fa12ac2..00000000
--- a/sop-book/sop-book-web/src/test/java/com/gitee/sop/bookweb/SopBookApplicationTests.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.gitee.sop.bookweb;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest
-public class SopBookApplicationTests {
-
- @Test
- public void contextLoads() {
- }
-
-}
-
diff --git a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/configuration/EasyopenServiceConfiguration.java b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/configuration/EasyopenServiceConfiguration.java
index 5f9497fc..015e7ab2 100644
--- a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/configuration/EasyopenServiceConfiguration.java
+++ b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/configuration/EasyopenServiceConfiguration.java
@@ -27,7 +27,7 @@ import java.util.function.Consumer;
public class EasyopenServiceConfiguration extends BaseServiceConfiguration {
static {
- ApiContext.getApiConfig().setIgnoreValidate(false);
+ ApiContext.getApiConfig().setIgnoreValidate(true);
}
@Override
diff --git a/sop-book/pom.xml b/sop-example/pom.xml
similarity index 73%
rename from sop-book/pom.xml
rename to sop-example/pom.xml
index 6a343033..a900cf0c 100644
--- a/sop-book/pom.xml
+++ b/sop-example/pom.xml
@@ -4,12 +4,13 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
com.gitee.sop
- sop-book-parent
+ sop-example
1.0.0-SNAPSHOT
pom
- sop-book-api
- sop-book-web
+ sop-story
+ sop-book
+ sop-easyopen
\ No newline at end of file
diff --git a/sop-example/readme.md b/sop-example/readme.md
new file mode 100644
index 00000000..4374a250
--- /dev/null
+++ b/sop-example/readme.md
@@ -0,0 +1,5 @@
+# 服务示例
+
+- sop-story:微服务示例,story服务,同时作为Provider提供服务
+- sop-book:微服务示例,book服务,也是Consumer,调用story提供的服务
+- sop-easyopen:整合easyopen示例
diff --git a/sop-story/pom.xml b/sop-story/pom.xml
deleted file mode 100644
index b2da4384..00000000
--- a/sop-story/pom.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
- 4.0.0
- com.gitee.sop-story
- sop-story-parent
- 1.0.0-SNAPSHOT
- pom
-
-
- sop-story-api
- sop-story-web
-
-
\ No newline at end of file
diff --git a/sop-story/sop-story-api/.gitignore b/sop-story/sop-story-api/.gitignore
deleted file mode 100644
index c456c4a3..00000000
--- a/sop-story/sop-story-api/.gitignore
+++ /dev/null
@@ -1,25 +0,0 @@
-/target/
-!.mvn/wrapper/maven-wrapper.jar
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-
-### NetBeans ###
-/nbproject/private/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
-/build/
diff --git a/sop-story/sop-story-api/pom.xml b/sop-story/sop-story-api/pom.xml
deleted file mode 100644
index 103848c1..00000000
--- a/sop-story/sop-story-api/pom.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
- 4.0.0
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.1.2.RELEASE
-
-
- com.gitee.sop
- sop-story-api
- 1.0-SNAPSHOT
-
-
- 1.8
- Greenwich.RELEASE
-
-
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
-
- org.projectlombok
- lombok
- 1.18.4
- provided
-
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-dependencies
- ${spring-cloud.version}
- pom
- import
-
-
-
-
\ No newline at end of file
diff --git a/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/domain/Story.java b/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/domain/Story.java
deleted file mode 100644
index d2cfbae0..00000000
--- a/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/domain/Story.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.gitee.sop.story.api.domain;
-
-import lombok.Data;
-import org.hibernate.validator.constraints.Length;
-
-import javax.validation.constraints.NotBlank;
-
-/**
- * @author tanghc
- */
-@Data
-public class Story {
- private int id;
-
- @NotBlank(message = "name不能为空")
- @Length(max = 20, message = "name长度不能超过20")
- private String name;
-}
diff --git a/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/service/StoryService.java b/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/service/StoryService.java
deleted file mode 100644
index 0b3c9794..00000000
--- a/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/service/StoryService.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.gitee.sop.story.api.service;
-
-import com.gitee.sop.story.api.domain.Story;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-
-/**
- * @author tanghc
- */
-@RequestMapping("/story")
-public interface StoryService {
- @RequestMapping("/getStory")
- Story getStory(@RequestParam("id")/* 必须指定@RequestParam,且value不能少 */
- int id);
-}
diff --git a/sop-story/sop-story-web/.gitignore b/sop-story/sop-story-web/.gitignore
deleted file mode 100644
index c456c4a3..00000000
--- a/sop-story/sop-story-web/.gitignore
+++ /dev/null
@@ -1,25 +0,0 @@
-/target/
-!.mvn/wrapper/maven-wrapper.jar
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-.sts4-cache
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-
-### NetBeans ###
-/nbproject/private/
-/nbbuild/
-/dist/
-/nbdist/
-/.nb-gradle/
-/build/
diff --git a/sop-story/sop-story-web/pom.xml b/sop-story/sop-story-web/pom.xml
deleted file mode 100644
index e03b1d40..00000000
--- a/sop-story/sop-story-web/pom.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
- 4.0.0
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.1.2.RELEASE
-
-
- com.gitee.sop
- sop-story-web
- 0.0.1-SNAPSHOT
- sop-story
- Demo project for Spring Boot
-
-
- 1.8
- Greenwich.RELEASE
-
-
-
-
- com.gitee.sop
- sop-service-common
- 1.0.0-SNAPSHOT
-
-
- com.gitee.sop
- sop-story-api
- 1.0-SNAPSHOT
-
-
- org.springframework.cloud
- spring-cloud-starter-netflix-eureka-client
-
-
- org.springframework.cloud
- spring-cloud-starter-openfeign
-
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
- org.projectlombok
- lombok
- 1.18.4
- provided
-
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-dependencies
- ${spring-cloud.version}
- pom
- import
-
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
-
-
-
diff --git a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/SopStoryApplication.java b/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/SopStoryApplication.java
deleted file mode 100644
index 16617166..00000000
--- a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/SopStoryApplication.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.gitee.sop.bookweb;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
-
-@EnableDiscoveryClient
-@SpringBootApplication
-public class SopStoryApplication {
-
- public static void main(String[] args) {
- SpringApplication.run(SopStoryApplication.class, args);
- }
-
-}
-
diff --git a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/config/OpenServiceConfig.java b/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/config/OpenServiceConfig.java
deleted file mode 100644
index 4aeba862..00000000
--- a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/config/OpenServiceConfig.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.gitee.sop.bookweb.config;
-
-import com.gitee.sop.servercommon.bean.ServiceConfig;
-import com.gitee.sop.servercommon.configuration.AlipayServiceConfiguration;
-import com.gitee.sop.servercommon.configuration.TaobaoServiceConfiguration;
-import org.springframework.context.annotation.Configuration;
-
-import javax.annotation.PostConstruct;
-
-/**
- * 使用支付宝开放平台功能
- * @author tanghc
- */
-@Configuration
-public class OpenServiceConfig extends AlipayServiceConfiguration {
-
-
- static {
- ServiceConfig.getInstance().getI18nModules().add("i18n/isp/goods_error");
- }
-
-}
-
-/**
- * 使用淘宝开放平台功能
- * @author tanghc
- */
-//@Configuration
-//public class OpenServiceConfig extends TaobaoServiceConfiguration {
-//
-//}
diff --git a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/AlipayController.java b/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/AlipayController.java
deleted file mode 100644
index ab433fd0..00000000
--- a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/AlipayController.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package com.gitee.sop.bookweb.controller;
-
-import com.gitee.sop.servercommon.annotation.ApiMapping;
-import com.gitee.sop.story.api.domain.Story;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * 支付宝服务端,假设签名验证通过后,到达这里进行具体的业务处理。
- * 这里演示如何接受业务参数。
- * @author tanghc
- */
-@RestController
-public class AlipayController {
-
- @ApiMapping(value = "alipay.story.get")
- public Story getStory() {
- Story story = new Story();
- story.setId(1);
- story.setName("海底小纵队(alipay.story.get)");
- return story;
- }
-
- @ApiMapping(value = "alipay.story.get", version = "1.2")
- public Story getStory11(Story story) {
- return story;
- }
-}
diff --git a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/JSR303DemoController.java b/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/JSR303DemoController.java
deleted file mode 100644
index f04340d5..00000000
--- a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/JSR303DemoController.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.gitee.sop.bookweb.controller;
-
-import com.gitee.sop.bookweb.controller.param.GoodsParam;
-import com.gitee.sop.servercommon.annotation.ApiMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * 演示参数验证
- * @author tanghc
- */
-@RestController
-public class JSR303DemoController {
-
- @ApiMapping(value = "goods.add")
- public Object addGoods(GoodsParam param) {
- return param;
- }
-}
diff --git a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/Story2Controller.java b/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/Story2Controller.java
deleted file mode 100644
index 6f37e27a..00000000
--- a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/Story2Controller.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.gitee.sop.bookweb.controller;
-
-import com.gitee.sop.servercommon.annotation.ApiAbility;
-import com.gitee.sop.servercommon.annotation.ApiMapping;
-import com.gitee.sop.story.api.domain.Story;
-import com.gitee.sop.story.api.service.StoryService;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @author tanghc
- */
-@ApiAbility // 放在这里,下面所有的接口都具备接口提供能力
-@RestController
-@RequestMapping("story2")
-public class Story2Controller{
-
- @RequestMapping("getStory4")
- public Story getStory4() {
- Story story = new Story();
- story.setId(1);
- story.setName("海底小纵队(getStory4)");
- return story;
- }
-
- // 优先使用方法上@ApiAbility
- @ApiAbility(version = "1.4")
- @RequestMapping("getStory4")
- public Story storyget() {
- Story story = new Story();
- story.setId(1);
- story.setName("海底小纵队(1.4)");
- return story;
- }
-
- // 优先使用@ApiMapping
- @ApiMapping(value = "story.get2")
- public Story getStory2() {
- Story story = new Story();
- story.setId(1);
- story.setName("海底小纵队story.get2");
- return story;
- }
-
-
-}
diff --git a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/StoryController.java b/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/StoryController.java
deleted file mode 100644
index d2233e6f..00000000
--- a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/StoryController.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package com.gitee.sop.bookweb.controller;
-
-import com.gitee.sop.servercommon.annotation.ApiMapping;
-import com.gitee.sop.servercommon.annotation.ApiAbility;
-import com.gitee.sop.story.api.domain.Story;
-import com.gitee.sop.story.api.service.StoryService;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @author tanghc
- */
-@RestController
-public class StoryController implements StoryService {
-
- // 提供给Feign的服务
- @Override
- public Story getStory(int id) {
- Story story = new Story();
- story.setId(id);
- story.setName("海底小纵队(Feign)");
- return story;
- }
-
- // http://localhost:2222/story/story_get
- // 原生的接口,可正常调用
- @RequestMapping("story_get")
- public Story getStory4() {
- Story story = new Story();
- story.setId(1);
- story.setName("海底小纵队(原生)");
- return story;
- }
-
- // http://localhost:2222/story/story.get/
- // 接口名,使用默认版本号
- @ApiMapping(value = "story.get")
- public Story storyget() {
- Story story = new Story();
- story.setId(1);
- story.setName("海底小纵队(默认版本号)");
- return story;
- }
-
- // http://localhost:2222/story/story.get/?version=1.1
- // 接口名 + 版本号
- @ApiMapping(value = "story.get", version = "1.1")
- public Story getStory2() {
- Story story = new Story();
- story.setId(1);
- story.setName("海底小纵队1.0");
- return story;
- }
-
- // http://localhost:2222/story/story.get/?version=2.0
- // 接口名 + 版本号
- @ApiMapping(value = "story.get", version = "2.0")
- public Story getStory20(Story story) {
- return story;
- }
-
- // http://localhost:2222/story/getStory2
- // 遗留接口具备开放平台能力
- @ApiAbility
- @RequestMapping("getStory2")
- public Story getStory2_0() {
- Story story = new Story();
- story.setId(1);
- story.setName("海底小纵队(默认版本号)");
- return story;
- }
-
- // http://localhost:2222/story/getStory2?version=2.1
- // 在原来的基础上加版本号
- @ApiAbility(version = "2.1")
- @RequestMapping("getStory2")
- public Story getStory2_1() {
- Story story = new Story();
- story.setId(1);
- story.setName("海底小纵队2.1");
- return story;
- }
-
-
-}
diff --git a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/StoryDemoController.java b/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/StoryDemoController.java
deleted file mode 100644
index fbc8a31f..00000000
--- a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/StoryDemoController.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.gitee.sop.bookweb.controller;
-
-import com.gitee.sop.servercommon.annotation.ApiMapping;
-import com.gitee.sop.story.api.domain.Story;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * @author tanghc
- */
-@RestController
-public class StoryDemoController {
-
- @ApiMapping(value = "story.demo.get")
- public Story getStory() {
- Story story = new Story();
- story.setId(1);
- story.setName("白雪公主");
- return story;
- }
-
-}
diff --git a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/ThrowExceptionDemoController.java b/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/ThrowExceptionDemoController.java
deleted file mode 100644
index 8fe8b7db..00000000
--- a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/ThrowExceptionDemoController.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package com.gitee.sop.bookweb.controller;
-
-import com.gitee.sop.bookweb.controller.param.GoodsUpdateParam;
-import com.gitee.sop.bookweb.message.GoodsErrorEnum;
-import com.gitee.sop.servercommon.annotation.ApiMapping;
-import com.gitee.sop.servercommon.exception.ServiceException;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * 演示如何抛出异常
- * @author tanghc
- */
-@RestController
-public class ThrowExceptionDemoController {
-
- @ApiMapping(value = "goods.update")
- public Object updateGoods(GoodsUpdateParam param) {
- // 方式1
- if ("iphone6".equals(param.getGoods_name())) {
- throw new ServiceException("不能更新iphone6");
- }
- // 方式2,国际化
- if (StringUtils.isEmpty(param.getGoods_name())) {
- throw GoodsErrorEnum.NO_GOODS_NAME.getErrorMeta().getException();
- }
- // 方式3,国际化传参
- if (param.getGoods_name().length() <= 3) {
- throw GoodsErrorEnum.LESS_GOODS_NAME_LEN.getErrorMeta().getException(3);
- }
- return param;
- }
-}
diff --git a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/param/GoodsParam.java b/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/param/GoodsParam.java
deleted file mode 100644
index 333cd59d..00000000
--- a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/param/GoodsParam.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.gitee.sop.bookweb.controller.param;
-
-import lombok.Data;
-import org.hibernate.validator.constraints.Length;
-
-import javax.validation.constraints.NotEmpty;
-
-@Data
-public class GoodsParam {
-// @NotEmpty(message = "商品名称不能为空")
- private String goods_name;
-
- @NotEmpty(message = "{goods.remark.notNull}")
- private String goods_remark;
-
- // 传参的格式:{xxx}=value1,value2...
- @Length(min = 3, max = 20, message = "{goods.comment.length}=3,20")
- private String goods_comment;
-}
\ No newline at end of file
diff --git a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/param/GoodsUpdateParam.java b/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/param/GoodsUpdateParam.java
deleted file mode 100644
index 3aab1d06..00000000
--- a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/controller/param/GoodsUpdateParam.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.gitee.sop.bookweb.controller.param;
-
-import lombok.Data;
-
-@Data
-public class GoodsUpdateParam {
- private String goods_name;
-
-}
\ No newline at end of file
diff --git a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/message/GoodsErrorEnum.java b/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/message/GoodsErrorEnum.java
deleted file mode 100644
index 77a3265a..00000000
--- a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/message/GoodsErrorEnum.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.gitee.sop.bookweb.message;
-
-import com.gitee.sop.servercommon.message.ServiceErrorMeta;
-
-public enum GoodsErrorEnum {
- /** 参数错误 */
- NO_GOODS_NAME("100"),
- /** 参数长度太短 */
- LESS_GOODS_NAME_LEN("101"),
- ;
- private ServiceErrorMeta errorMeta;
-
- GoodsErrorEnum(String subCode) {
- this.errorMeta = new ServiceErrorMeta("isp.goods_error_", subCode);
- }
-
- public ServiceErrorMeta getErrorMeta() {
- return errorMeta;
- }
-}
\ No newline at end of file
diff --git a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/message/StoryErrorEnum.java b/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/message/StoryErrorEnum.java
deleted file mode 100644
index 23c29395..00000000
--- a/sop-story/sop-story-web/src/main/java/com/gitee/sop/bookweb/message/StoryErrorEnum.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.gitee.sop.bookweb.message;
-
-import com.gitee.sop.servercommon.message.ServiceErrorMeta;
-
-/**
- * @author tanghc
- */
-public enum StoryErrorEnum {
- /** 参数错误 */
- param_error("isv.invalid-parameter"),
- ;
- private ServiceErrorMeta errorMeta;
-
- StoryErrorEnum(String subCode) {
- this.errorMeta = new ServiceErrorMeta("isp.error_", subCode);
- }
-
- public ServiceErrorMeta getErrorMeta() {
- return errorMeta;
- }
-}
diff --git a/sop-story/sop-story-web/src/main/resources/application.yml b/sop-story/sop-story-web/src/main/resources/application.yml
deleted file mode 100644
index 2972c510..00000000
--- a/sop-story/sop-story-web/src/main/resources/application.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-server:
- port: 2222
-
-eureka:
- port: 1111
- host: localhost
- client:
- serviceUrl:
- defaultZone: http://${eureka.host}:${eureka.port}/eureka/
\ No newline at end of file
diff --git a/sop-story/sop-story-web/src/main/resources/bootstrap.yml b/sop-story/sop-story-web/src/main/resources/bootstrap.yml
deleted file mode 100644
index 0a4dcf3e..00000000
--- a/sop-story/sop-story-web/src/main/resources/bootstrap.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-spring:
- application:
- name: story-service
- description: story服务
-
- cloud:
- zookeeper:
- connect-string: localhost:2181
\ No newline at end of file
diff --git a/sop-story/sop-story-web/src/main/resources/i18n/isp/bizerror_en.properties b/sop-story/sop-story-web/src/main/resources/i18n/isp/bizerror_en.properties
deleted file mode 100644
index 48d134c8..00000000
--- a/sop-story/sop-story-web/src/main/resources/i18n/isp/bizerror_en.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-# 错误配置
-
-# 系统配置
-isp.error_isv.common-error=The system is busy.
-isp.error_isv.invalid-parameter=Invalid parameter, {0}
-
-# ==== 参数配置 ====
-
-goods.remark.notNull=The goods_remark can not be null
-goods.comment.length=The goods_comment length must >= {0} and <= {1}
\ No newline at end of file
diff --git a/sop-story/sop-story-web/src/main/resources/i18n/isp/bizerror_zh_CN.properties b/sop-story/sop-story-web/src/main/resources/i18n/isp/bizerror_zh_CN.properties
deleted file mode 100644
index 4ac48428..00000000
--- a/sop-story/sop-story-web/src/main/resources/i18n/isp/bizerror_zh_CN.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-# 错误配置
-
-# 系统繁忙
-isp.error_isv.common-error=\u7cfb\u7edf\u7e41\u5fd9
-# 参数无效
-isp.error_isv.invalid-parameter=\u53c2\u6570\u65e0\u6548, {0}
-
-# ==== 参数配置 ====
-
-# 商品备注不能为空
-goods.remark.notNull=\u5546\u54c1\u5907\u6ce8\u4e0d\u80fd\u4e3a\u7a7a
-# 商品评论长度必须在{0}和{1}之间
-goods.comment.length=\u5546\u54c1\u8bc4\u8bba\u957f\u5ea6\u5fc5\u987b\u5728{0}\u548c{1}\u4e4b\u95f4
-
diff --git a/sop-story/sop-story-web/src/main/resources/i18n/isp/goods_error_en.properties b/sop-story/sop-story-web/src/main/resources/i18n/isp/goods_error_en.properties
deleted file mode 100644
index 195c7d2b..00000000
--- a/sop-story/sop-story-web/src/main/resources/i18n/isp/goods_error_en.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-isp.goods_error_100=the goods_name can NOT be null
-isp.goods_error_101=the goods_name must bigger than {0}
\ No newline at end of file
diff --git a/sop-story/sop-story-web/src/main/resources/i18n/isp/goods_error_zh_CN.properties b/sop-story/sop-story-web/src/main/resources/i18n/isp/goods_error_zh_CN.properties
deleted file mode 100644
index af1a43bc..00000000
--- a/sop-story/sop-story-web/src/main/resources/i18n/isp/goods_error_zh_CN.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-# 商品名字不能为空
-isp.goods_error_100=\u5546\u54C1\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A
-
-# 商品名称太短,不能小于{0}个字
-isp.goods_error_101=\u5546\u54C1\u540D\u79F0\u592A\u77ED\uFF0C\u4E0D\u80FD\u5C0F\u4E8E{0}\u4E2A\u5B57
\ No newline at end of file
diff --git a/sop-story/sop-story-web/src/test/java/com/gitee/sop/bookweb/SopStoryApplicationTests.java b/sop-story/sop-story-web/src/test/java/com/gitee/sop/bookweb/SopStoryApplicationTests.java
deleted file mode 100644
index ba442149..00000000
--- a/sop-story/sop-story-web/src/test/java/com/gitee/sop/bookweb/SopStoryApplicationTests.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.gitee.sop.bookweb;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest
-public class SopStoryApplicationTests {
-
- @Test
- public void contextLoads() {
- }
-
-}
-