- 4.0.0
+
com.gitee.sop
- sop-common
- 3.1.5-SNAPSHOT
- ../pom.xml
+ sop-parent
+ 1.0.0-SNAPSHOT
+ ../../pom.xml
+
+ 4.0.0
sop-service-common
- 3.1.5-SNAPSHOT
+ 3.2.0-SNAPSHOT
jar
- sop-service-common
- sop-service-common
-
1.8
@@ -25,7 +24,16 @@
com.google.guava
guava
- 27.1-jre
+
+
+
+ org.apache.commons
+ commons-lang3
+
+
+
+ commons-io
+ commons-io
@@ -38,19 +46,16 @@
net.oschina.durcframework
easyopen
- 1.16.1
true
io.springfox
springfox-spring-web
- 2.9.2
true
io.swagger
swagger-annotations
- 1.5.21
true
@@ -76,6 +81,17 @@
3.0.0
test
+
+
+ org.projectlombok
+ lombok
+ provided
+
+
+ javax.servlet
+ javax.servlet-api
+ provided
+
diff --git a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/manager/RedisApiMetaManager.java b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/manager/RedisApiMetaManager.java
deleted file mode 100644
index 27c792cb..00000000
--- a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/manager/RedisApiMetaManager.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.gitee.sop.servercommon.manager;
-
-import com.alibaba.fastjson.JSON;
-import com.gitee.sop.servercommon.bean.ServiceApiInfo;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.data.redis.core.StringRedisTemplate;
-
-/**
- * @author tanghc
- */
-@Slf4j
-public class RedisApiMetaManager implements ApiMetaManager {
- public static final String API_STORE_KEY = "com.gitee.sop.api";
- public static final String API_CHANGE_CHANNEL = "channel.sop.api.change";
-
- private StringRedisTemplate redisTemplate;
-
- public RedisApiMetaManager(StringRedisTemplate redisTemplate) {
- this.redisTemplate = redisTemplate;
- }
-
- @Override
- public void uploadApi(ServiceApiInfo serviceApiInfo) {
- log.info("上传接口信息到Redis,serviceId:{}, 接口数量:{}", serviceApiInfo.getServiceId(), serviceApiInfo.getApis().size());
- String serviceApiInfoJson = JSON.toJSONString(serviceApiInfo);
- redisTemplate.opsForHash().put(API_STORE_KEY, serviceApiInfo.getServiceId(), serviceApiInfoJson);
- // 发送订阅事件
- redisTemplate.convertAndSend(API_CHANGE_CHANNEL, serviceApiInfoJson);
- }
-}
diff --git a/sop-example/pom.xml b/sop-example/pom.xml
index a3efa857..985954fc 100644
--- a/sop-example/pom.xml
+++ b/sop-example/pom.xml
@@ -2,16 +2,19 @@
+
+ com.gitee.sop
+ sop-parent
+ 1.0.0-SNAPSHOT
+ ../pom.xml
+
+
4.0.0
- com.gitee.sop
sop-example
- 1.0.0-SNAPSHOT
pom
sop-story
- sop-book
- sop-easyopen
sop-springmvc
\ No newline at end of file
diff --git a/sop-example/readme.md b/sop-example/readme.md
index eeafbca8..f2dc17a7 100644
--- a/sop-example/readme.md
+++ b/sop-example/readme.md
@@ -1,7 +1,5 @@
# 服务示例
-- sop-story:微服务示例,story服务,同时作为Provider提供服务。本地文档:http://localhost:2222/doc.html
-- sop-book:微服务示例,book服务,也是Consumer,调用story提供的服务
+- sop-story:微服务示例
- sop-auth:应用授权示例
- sop-springmvc:springmvc工程实例
-- sop-easyopen:整合easyopen示例
diff --git a/sop-example/sop-book/pom.xml b/sop-example/sop-book/pom.xml
deleted file mode 100644
index 6a343033..00000000
--- a/sop-example/sop-book/pom.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
- 4.0.0
- com.gitee.sop
- sop-book-parent
- 1.0.0-SNAPSHOT
- pom
-
-
- sop-book-api
- sop-book-web
-
-
\ No newline at end of file
diff --git a/sop-example/sop-book/sop-book-api/.gitignore b/sop-example/sop-book/sop-book-api/.gitignore
deleted file mode 100644
index c456c4a3..00000000
--- a/sop-example/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-example/sop-book/sop-book-api/pom.xml b/sop-example/sop-book/sop-book-api/pom.xml
deleted file mode 100644
index c47d23c4..00000000
--- a/sop-example/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-example/sop-book/sop-book-api/src/main/java/com/gitee/book/api/domain/Book.java b/sop-example/sop-book/sop-book-api/src/main/java/com/gitee/book/api/domain/Book.java
deleted file mode 100644
index a286924a..00000000
--- a/sop-example/sop-book/sop-book-api/src/main/java/com/gitee/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-example/sop-book/sop-book-api/src/main/java/com/gitee/book/api/service/BookService.java b/sop-example/sop-book/sop-book-api/src/main/java/com/gitee/book/api/service/BookService.java
deleted file mode 100644
index 66d5d90e..00000000
--- a/sop-example/sop-book/sop-book-api/src/main/java/com/gitee/book/api/service/BookService.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.gitee.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-example/sop-book/sop-book-web/.gitignore b/sop-example/sop-book/sop-book-web/.gitignore
deleted file mode 100644
index c456c4a3..00000000
--- a/sop-example/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-example/sop-book/sop-book-web/pom.xml b/sop-example/sop-book/sop-book-web/pom.xml
deleted file mode 100644
index 3fdcfb7c..00000000
--- a/sop-example/sop-book/sop-book-web/pom.xml
+++ /dev/null
@@ -1,153 +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-book
- Demo project for Spring Boot
-
-
- 1.8
- 2.6.5
- Greenwich.RELEASE
-
- 0.9.0.RELEASE
-
- 1.1.3
-
-
-
-
- com.gitee.sop
- sop-service-common
- 3.1.5-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
-
-
-
-
- com.alibaba.boot
- dubbo-spring-boot-starter
- 0.2.1.RELEASE
-
-
- com.alibaba
- dubbo
- ${dubbo.version}
-
-
- io.netty
- netty-all
-
-
-
-
- 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
- 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-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/SopBookApplication.java b/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/SopBookApplication.java
deleted file mode 100644
index cfb16be7..00000000
--- a/sop-example/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-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
deleted file mode 100644
index a84ddea8..00000000
--- a/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/config/OpenServiceConfig.java
+++ /dev/null
@@ -1,33 +0,0 @@
-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;
-
-/**
- * 使用支付宝开放平台功能
- * @author tanghc
- */
-@Configuration
-public class OpenServiceConfig extends AlipayServiceConfiguration {
-
- // 开启文档
- @Configuration
- @EnableSwagger2
- public static class Swagger2 extends SwaggerSupport {
- @Override
- protected String getDocTitle() {
- return "图书API";
- }
- }
-}
-
-/**
- * 使用淘宝开放平台功能
- * @author tanghc
- */
-//@Configuration
-//public class OpenServiceConfig extends TaobaoServiceConfiguration {
-//
-//}
diff --git a/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/consumer/StoryServiceConsumer.java b/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/consumer/StoryServiceConsumer.java
deleted file mode 100644
index cce5945b..00000000
--- a/sop-example/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-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
deleted file mode 100644
index eff28c56..00000000
--- a/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/AlipayBookController.java
+++ /dev/null
@@ -1,55 +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.bookweb.vo.BookVO;
-import com.gitee.sop.servercommon.annotation.ApiMapping;
-import com.gitee.sop.story.api.domain.Story;
-import io.swagger.annotations.Api;
-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
- */
-@Api(tags = "图书接口")
-@RestController
-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 Book getBook() {
- Book story = new Book();
- story.setId(1);
- story.setName("白雪公主(alipay.book.get)");
- return story;
- }
-
- // 通过Feign调用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-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/ApiResult.java b/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/ApiResult.java
deleted file mode 100644
index a102dfa8..00000000
--- a/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/ApiResult.java
+++ /dev/null
@@ -1,72 +0,0 @@
-package com.gitee.sop.bookweb.controller;
-
-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
- */
-@Data
-public class ApiResult {
-
- /**
- * 网关异常信息
- */
- private String msg;
-
- /**
- * 业务异常码
- */
- private String sub_msg;
-
- /**
- * 业务异常信息
- */
- private String sub_code;
-
- /**
- * 返回结果
- */
- private Object data;
-}
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
deleted file mode 100644
index 710db1a5..00000000
--- a/sop-example/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.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;
-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-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/DubboConsumerController.java b/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/DubboConsumerController.java
deleted file mode 100644
index 431c0a81..00000000
--- a/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/controller/DubboConsumerController.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.gitee.sop.bookweb.controller;
-
-import com.alibaba.dubbo.config.annotation.Reference;
-import com.gitee.sop.servercommon.annotation.ApiMapping;
-import com.gitee.sop.story.api.domain.Story;
-import com.gitee.sop.story.api.param.DemoParam;
-import com.gitee.sop.story.api.result.DemoResult;
-import com.gitee.sop.story.api.service.DemoService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.web.bind.annotation.RestController;
-
-/**
- * 调用dubbo服务,provider是story,见DefaultDemoService.java
- * dubbo配置方式参见:https://github.com/apache/dubbo-spring-boot-project/blob/0.2.x/README_CN.md
- *
- * 对比SpringCloud提供的Feign,dubbo会方便很多。
- *
- * Feign的使用方式参见:com.gitee.sop.bookweb.controller.AlipayBookController#getBook2()
- */
-@RestController
-@Slf4j
-public class DubboConsumerController {
-
- @Reference(version = "1.0.0", url = "dubbo://127.0.0.1:12345")
- private DemoService demoService;
-
- // 作为开放接口
- @ApiMapping(value = "dubbo.story.get")
- public Story openApi(DemoParam demoParam) {
- log.info("dubbo consumer, param: {}", demoParam);
- // 通过dubbo调用story提供的服务
- DemoResult dubboStory = demoService.getStory(demoParam);
- Story story = new Story();
- story.setId(dubboStory.getId());
- story.setName(dubboStory.getName());
- return story;
- }
-
-
-}
\ No newline at end of file
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
deleted file mode 100644
index 14841d9d..00000000
--- a/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/param/BookParam.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.gitee.sop.bookweb.param;
-
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-/**
- * @author tanghc
- */
-@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
deleted file mode 100644
index 8ae601b5..00000000
--- a/sop-example/sop-book/sop-book-web/src/main/java/com/gitee/sop/bookweb/vo/BookVO.java
+++ /dev/null
@@ -1,16 +0,0 @@
-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-book/sop-book-web/src/main/resources/application-dev.properties b/sop-example/sop-book/sop-book-web/src/main/resources/application-dev.properties
deleted file mode 100644
index 5d705fbc..00000000
--- a/sop-example/sop-book/sop-book-web/src/main/resources/application-dev.properties
+++ /dev/null
@@ -1,19 +0,0 @@
-server.port=3333
-spring.application.name=book-service
-
-# nacos注册中心
-#spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
-
-# eureka注册中心
-eureka.client.serviceUrl.defaultZone=http://localhost:1111/eureka/
-
-# consumer不需要检查provider是否启动
-dubbo.consumer.check=false
-
-# zipkin服务跟踪
-#spring.zipkin.base-url=http://127.0.0.1:9411/
-## 设置sleuth收集信息的比率,默认0.1,最大是1,数字越大越耗性能
-#spring.sleuth.sampler.probability=1
-## dubbo使用zipkin过滤器
-#dubbo.provider.filter=tracing
-#dubbo.consumer.filter=tracing
diff --git a/sop-example/sop-book/sop-book-web/src/test/java/com/gitee/sop/bookweb/SopBookApplicationTests.java b/sop-example/sop-book/sop-book-web/src/test/java/com/gitee/sop/bookweb/SopBookApplicationTests.java
deleted file mode 100644
index 6fa12ac2..00000000
--- a/sop-example/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-example/sop-easyopen/.gitignore b/sop-example/sop-easyopen/.gitignore
deleted file mode 100644
index 18ccf36e..00000000
--- a/sop-example/sop-easyopen/.gitignore
+++ /dev/null
@@ -1,25 +0,0 @@
-target/
-!.mvn/wrapper/maven-wrapper.jar
-
-### STS ###
-.apt_generated
-.classpath
-.factorypath
-.project
-.settings
-.springBeans
-
-### IntelliJ IDEA ###
-.idea
-*.iws
-*.iml
-*.ipr
-
-### NetBeans ###
-nbproject/private/
-build/
-nbbuild/
-dist/
-nbdist/
-.nb-gradle/
-/local-config/
diff --git a/sop-example/sop-easyopen/pom.xml b/sop-example/sop-easyopen/pom.xml
deleted file mode 100644
index 55c705f1..00000000
--- a/sop-example/sop-easyopen/pom.xml
+++ /dev/null
@@ -1,132 +0,0 @@
-
-
- 4.0.0
- com.gitee.sop
- sop-easyopen
- 1.0.0-SNAPSHOT
- jar
-
- easyopen-server
- easyopen Demo project for Spring Boot
-
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.1.2.RELEASE
-
-
-
-
- UTF-8
- UTF-8
- Greenwich.RELEASE
- 1.8
-
-
-
-
-
- com.gitee.sop
- sop-service-common
- 3.1.5-SNAPSHOT
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-starter-netflix-eureka-client
-
-
-
- net.oschina.durcframework
- easyopen
- 1.16.8
-
-
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
- org.springframework.boot
- spring-boot-starter-thymeleaf
-
-
-
- org.springframework.boot
- spring-boot-starter-data-redis
-
-
-
- org.springframework.boot
- spring-boot-configuration-processor
- true
-
-
- org.springframework.boot
- spring-boot-devtools
- true
-
-
-
- org.springframework.boot
- spring-boot-starter-test
- test
-
-
-
-
-
-
-
- org.springframework.cloud
- spring-cloud-dependencies
- ${spring-cloud.version}
- pom
- import
-
-
-
-
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
- true
-
-
-
-
-
-
-
diff --git a/sop-example/sop-easyopen/readme.md b/sop-example/sop-easyopen/readme.md
deleted file mode 100644
index 20cb4998..00000000
--- a/sop-example/sop-easyopen/readme.md
+++ /dev/null
@@ -1,31 +0,0 @@
-# easyopen-server
-
-接口服务器空项目,可在此基础上做开发。
-
-入口类:IndexController
-
-业务类在api下,重点关注这里即可。
-
-```
-└─com.gitee.easyopen.server
- │ EmptySpringbootApplication.java // springboot启动类
- │ IndexController.java // easyopen入口类
- │
- ├─api // 存放接口
- │ │ GoodsApi.java // 示例接口
- │ │
- │ ├─param // 存放接口参数类
- │ │ GoodsParam.java
- │ │
- │ └─result // 存放放回接口类
- │ Goods.java
- │
- ├─config // spring配置
- │ CorsConfig.java
- │
- ├─interceptor // easyopen拦截器
- │ LogInterceptor.java
- │
- └─message // 错误处理
- CommonErrors.java
-```
\ No newline at end of file
diff --git a/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/IndexController.java b/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/IndexController.java
deleted file mode 100644
index aec16dd7..00000000
--- a/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/IndexController.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.gitee.easyopen.server;
-
-import com.gitee.easyopen.ApiConfig;
-import com.gitee.easyopen.support.ApiController;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * 文档地址:http://localhost:8080/api/doc
- */
-@Controller
-@RequestMapping("api")
-public class IndexController extends ApiController {
- @Override
- protected void initApiConfig(ApiConfig apiConfig) {
- apiConfig.setShowDoc(true); // 显示文档页面
- // 配置国际化消息
- Map appSecretStore = new HashMap();
- appSecretStore.put("test", "123456");
- apiConfig.addAppSecret(appSecretStore);
- }
-}
diff --git a/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/SopEasyopenApplication.java b/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/SopEasyopenApplication.java
deleted file mode 100644
index f42762f5..00000000
--- a/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/SopEasyopenApplication.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.gitee.easyopen.server;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
-
-@EnableDiscoveryClient
-@SpringBootApplication
-public class SopEasyopenApplication {
-
- public static void main(String[] args) {
- SpringApplication.run(SopEasyopenApplication.class, args);
- }
-}
diff --git a/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/api/Goods2Api.java b/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/api/Goods2Api.java
deleted file mode 100644
index b41676cf..00000000
--- a/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/api/Goods2Api.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.gitee.easyopen.server.api;
-
-import com.gitee.easyopen.annotation.Api;
-import com.gitee.easyopen.annotation.ApiService;
-import com.gitee.easyopen.doc.annotation.ApiDoc;
-import com.gitee.easyopen.doc.annotation.ApiDocMethod;
-import com.gitee.easyopen.server.api.param.GoodsParam;
-import com.gitee.easyopen.server.api.result.Goods;
-
-import java.math.BigDecimal;
-
-/**
- * 业务类
- *
- * @author tanghc
- */
-@ApiService
-@ApiDoc("库存接口")
-public class Goods2Api {
-
- @Api(name = "store.get")
- @ApiDocMethod(description = "获取库存")
- Goods getGoods(GoodsParam param) {
- Goods goods = new Goods();
- goods.setId(1L);
- goods.setGoods_name("苹果iPhoneX");
- goods.setPrice(new BigDecimal(8000));
- return goods;
- }
-
-}
diff --git a/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/api/GoodsApi.java b/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/api/GoodsApi.java
deleted file mode 100644
index bd848d3f..00000000
--- a/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/api/GoodsApi.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.gitee.easyopen.server.api;
-
-import com.gitee.easyopen.annotation.Api;
-import com.gitee.easyopen.annotation.ApiService;
-import com.gitee.easyopen.doc.annotation.ApiDoc;
-import com.gitee.easyopen.doc.annotation.ApiDocMethod;
-import com.gitee.easyopen.server.api.param.GoodsParam;
-import com.gitee.easyopen.server.api.result.Goods;
-
-import java.math.BigDecimal;
-
-/**
- * 业务类
- *
- * @author tanghc
- */
-@ApiService
-@ApiDoc("商品接口")
-public class GoodsApi {
-
- @Api(name = "easyopen.goods.get")
- @ApiDocMethod(description = "获取商品")
- Goods getGoods(GoodsParam param) {
- Goods goods = new Goods();
- goods.setId(1L);
- goods.setGoods_name("苹果iPhoneX");
- goods.setPrice(new BigDecimal(8000));
- return goods;
- }
-
-}
diff --git a/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/api/param/GoodsParam.java b/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/api/param/GoodsParam.java
deleted file mode 100644
index c3f500c1..00000000
--- a/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/api/param/GoodsParam.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.gitee.easyopen.server.api.param;
-
-import com.gitee.easyopen.doc.annotation.ApiDocField;
-import org.hibernate.validator.constraints.Length;
-
-import javax.validation.constraints.NotEmpty;
-
-public class GoodsParam {
-
- @ApiDocField(description = "商品名称", required = true, example = "iphoneX")
- @NotEmpty(message = "商品名称不能为空")
- @Length(min = 3, max = 20, message = "{goods.name.length}=3,20")
- private String goods_name;
-
- public String getGoods_name() {
- return goods_name;
- }
-
- public void setGoods_name(String goods_name) {
- this.goods_name = goods_name;
- }
-
-}
diff --git a/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/api/result/Goods.java b/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/api/result/Goods.java
deleted file mode 100644
index 7ad6e9a9..00000000
--- a/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/api/result/Goods.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.gitee.easyopen.server.api.result;
-
-import com.gitee.easyopen.doc.DataType;
-import com.gitee.easyopen.doc.annotation.ApiDocField;
-
-import java.math.BigDecimal;
-
-public class Goods {
-
- @ApiDocField(description = "id")
- private Long id;
- @ApiDocField(description = "商品名称")
- private String goods_name;
- @ApiDocField(description = "价格", dataType = DataType.FLOAT)
- private BigDecimal price;
-
- public Long getId() {
- return id;
- }
-
- public void setId(Long id) {
- this.id = id;
- }
-
- public String getGoods_name() {
- return goods_name;
- }
-
- public void setGoods_name(String goods_name) {
- this.goods_name = goods_name;
- }
-
- public BigDecimal getPrice() {
- return price;
- }
-
- public void setPrice(BigDecimal price) {
- this.price = price;
- }
-
- @Override
- public String toString() {
- return "Goods [id=" + id + ", goods_name=" + goods_name + ", price=" + price + "]";
- }
-
-}
diff --git a/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/config/CorsConfig.java b/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/config/CorsConfig.java
deleted file mode 100644
index 9c3c8d60..00000000
--- a/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/config/CorsConfig.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.gitee.easyopen.server.config;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.cors.CorsConfiguration;
-import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
-import org.springframework.web.filter.CorsFilter;
-
-/**
- * 解决js跨域
- * @author tanghc
- */
-@Configuration
-public class CorsConfig {
-
- /**
- * 跨域过滤器
- *
- * @return
- */
- @Bean
- public CorsFilter corsFilter() {
- UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
- source.registerCorsConfiguration("/**", buildConfig()); // 4
- return new CorsFilter(source);
- }
-
- private CorsConfiguration buildConfig() {
- CorsConfiguration corsConfiguration = new CorsConfiguration();
- corsConfiguration.addAllowedOrigin("*");
- corsConfiguration.addAllowedHeader("*");
- corsConfiguration.addAllowedMethod("*");
- return corsConfiguration;
- }
-
-
-}
diff --git a/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/config/SopConfig.java b/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/config/SopConfig.java
deleted file mode 100644
index 4228df21..00000000
--- a/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/config/SopConfig.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package com.gitee.easyopen.server.config;
-
-import com.gitee.sop.servercommon.configuration.EasyopenDocSupportController;
-import com.gitee.sop.servercommon.easyopen.EasyopenServiceConfiguration;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
-
-/**
- * @author tanghc
- */
-@Configuration
-public class SopConfig extends EasyopenServiceConfiguration {
-
- @Controller
- public static class SopDocController extends EasyopenDocSupportController {
- @Override
- public String getDocTitle() {
- return "商品API";
- }
- }
-
- @Override
- public void addResourceHandlers(ResourceHandlerRegistry registry) {
- //配置映射关系
- registry.addResourceHandler("/opendoc/**").addResourceLocations("classpath:/META-INF/resources/opendoc/");
- }
-}
diff --git a/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/interceptor/LogInterceptor.java b/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/interceptor/LogInterceptor.java
deleted file mode 100644
index 87e74910..00000000
--- a/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/interceptor/LogInterceptor.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.gitee.easyopen.server.interceptor;
-
-import com.gitee.easyopen.ApiContext;
-import com.gitee.easyopen.interceptor.ApiInterceptorAdapter;
-import com.gitee.easyopen.util.RequestUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.net.URLDecoder;
-
-public class LogInterceptor extends ApiInterceptorAdapter {
-
- Logger logger = LoggerFactory.getLogger(getClass());
-
- @Override
- public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object serviceObj, Object argu)
- throws Exception {
- logger.info("收到客户端请求,ip={},参数={}", RequestUtil.getClientIP(request), URLDecoder.decode(ApiContext.getApiParam().toJSONString(), "UTF-8"));
- return true;
- }
-}
diff --git a/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/message/CommonErrors.java b/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/message/CommonErrors.java
deleted file mode 100644
index ecee0784..00000000
--- a/sop-example/sop-easyopen/src/main/java/com/gitee/easyopen/server/message/CommonErrors.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.gitee.easyopen.server.message;
-
-import com.gitee.easyopen.message.ErrorMeta;
-
-/**
- * 错误码放在这里
- *
- * 使用方式:throw CommonErrors.NUll_ERROR.getException();
- */
-public interface CommonErrors {
- String isvModule = "isv.error_"; // error_zh_CN2.properties内容前缀
-
- ErrorMeta NUll_ERROR = new ErrorMeta(isvModule, "200", "不能为空");
-
-
-}
diff --git a/sop-example/sop-easyopen/src/main/resources/application-dev.properties b/sop-example/sop-easyopen/src/main/resources/application-dev.properties
deleted file mode 100644
index f6f62ae7..00000000
--- a/sop-example/sop-easyopen/src/main/resources/application-dev.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-server.port=2121
-spring.application.name=easyopen-service
-
-# eureka注册中心
-eureka.client.serviceUrl.defaultZone=http://localhost:1111/eureka/
-
-easyopen.prefix-path=/api
diff --git a/sop-example/sop-easyopen/src/main/resources/application.properties b/sop-example/sop-easyopen/src/main/resources/application.properties
deleted file mode 100644
index 257b3064..00000000
--- a/sop-example/sop-easyopen/src/main/resources/application.properties
+++ /dev/null
@@ -1 +0,0 @@
-spring.profiles.active=dev
\ No newline at end of file
diff --git a/sop-example/sop-easyopen/src/main/resources/i18n/isv/error_zh_CN.properties b/sop-example/sop-easyopen/src/main/resources/i18n/isv/error_zh_CN.properties
deleted file mode 100644
index 17981dd1..00000000
--- a/sop-example/sop-easyopen/src/main/resources/i18n/isv/error_zh_CN.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-# common errors here
-isv.error_200=\u4E0D\u80FD\u4E3A\u7A7A
diff --git a/sop-example/sop-easyopen/src/test/java/com/gitee/sop/adminserver/SopEasyopenApplicationApplicationTests.java b/sop-example/sop-easyopen/src/test/java/com/gitee/sop/adminserver/SopEasyopenApplicationApplicationTests.java
deleted file mode 100644
index 08b53786..00000000
--- a/sop-example/sop-easyopen/src/test/java/com/gitee/sop/adminserver/SopEasyopenApplicationApplicationTests.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.gitee.sop.adminserver;
-
-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 SopEasyopenApplicationApplicationTests {
-
- @Test
- public void contextLoads() {
- }
-
-}
diff --git a/sop-example/sop-springmvc/pom.xml b/sop-example/sop-springmvc/pom.xml
index d0b2022a..43efd3c4 100644
--- a/sop-example/sop-springmvc/pom.xml
+++ b/sop-example/sop-springmvc/pom.xml
@@ -1,12 +1,18 @@
+
+
+ com.gitee.sop
+ sop-parent
+ 1.0.0-SNAPSHOT
+ ../../pom.xml
+
+
4.0.0
- com.gitee.sop
sop-springmvc
sop-springmvc
war
- 1.0.0-SNAPSHOT
1.8
@@ -20,7 +26,7 @@
com.gitee.sop
sop-service-common
- 3.1.5-SNAPSHOT
+ 3.2.0-SNAPSHOT
@@ -43,6 +49,11 @@
${org.springframework-version}
+
+ org.hibernate.validator
+ hibernate-validator
+
+
com.fasterxml.jackson.core
diff --git a/sop-example/sop-story/pom.xml b/sop-example/sop-story/pom.xml
index b2da4384..5fdc63bd 100644
--- a/sop-example/sop-story/pom.xml
+++ b/sop-example/sop-story/pom.xml
@@ -1,15 +1,93 @@
-
+
+ com.gitee.sop
+ sop-parent
+ 1.0.0-SNAPSHOT
+ ../../pom.xml
+
+
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
+ sop-story
+
+
+ 1.8
+
+
+
+
+ com.gitee.sop
+ sop-service-common
+ 3.2.0-SNAPSHOT
+
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-discovery
+
+
+
+
+ org.springframework.cloud
+ spring-cloud-starter-openfeign
+
+
+
+
+ io.springfox
+ springfox-swagger2
+ 2.9.2
+
+
+ com.github.xiaoymin
+ swagger-bootstrap-ui
+ 1.9.5
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ org.projectlombok
+ lombok
+ 1.18.4
+ provided
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 2.12.4
+
+ true
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+
+
+
+
+
+
+ spring-milestones
+ Spring Milestones
+ https://repo.spring.io/milestone
+
+
+
+
diff --git a/sop-example/sop-story/sop-story-api/.gitignore b/sop-example/sop-story/sop-story-api/.gitignore
deleted file mode 100644
index c456c4a3..00000000
--- a/sop-example/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-example/sop-story/sop-story-api/pom.xml b/sop-example/sop-story/sop-story-api/pom.xml
deleted file mode 100644
index 103848c1..00000000
--- a/sop-example/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-example/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/domain/Story.java b/sop-example/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-example/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-example/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/param/DemoParam.java b/sop-example/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/param/DemoParam.java
deleted file mode 100644
index 36a0ce3c..00000000
--- a/sop-example/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/param/DemoParam.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.gitee.sop.story.api.param;
-
-import lombok.Data;
-
-import java.io.Serializable;
-
-/**
- * dubbo 参数
- * @author tanghc
- */
-@Data
-public class DemoParam implements Serializable {
- private int id;
-}
diff --git a/sop-example/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/result/DemoResult.java b/sop-example/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/result/DemoResult.java
deleted file mode 100644
index 3be828f5..00000000
--- a/sop-example/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/result/DemoResult.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package com.gitee.sop.story.api.result;
-
-import lombok.Data;
-
-import java.io.Serializable;
-
-/**
- * dubbo返回结果
- * @author tanghc
- */
-@Data
-public class DemoResult implements Serializable {
- private int id;
- private String name;
-}
diff --git a/sop-example/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/service/DemoService.java b/sop-example/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/service/DemoService.java
deleted file mode 100644
index 67c382d7..00000000
--- a/sop-example/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/service/DemoService.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.gitee.sop.story.api.service;
-
-import com.gitee.sop.story.api.param.DemoParam;
-import com.gitee.sop.story.api.result.DemoResult;
-
-public interface DemoService {
-
- String sayHello(String name);
-
- /**
- * 获取故事名称
- * @param param
- * @return
- */
- DemoResult getStory(DemoParam param);
-
-}
\ No newline at end of file
diff --git a/sop-example/sop-story/sop-story-api/src/main/java/com/gitee/sop/story/api/service/StoryService.java b/sop-example/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-example/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-example/sop-story/sop-story-web/.gitignore b/sop-example/sop-story/sop-story-web/.gitignore
deleted file mode 100644
index c456c4a3..00000000
--- a/sop-example/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-example/sop-story/sop-story-web/pom.xml b/sop-example/sop-story/sop-story-web/pom.xml
deleted file mode 100644
index 41946680..00000000
--- a/sop-example/sop-story/sop-story-web/pom.xml
+++ /dev/null
@@ -1,146 +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
- 2.6.5
- Greenwich.RELEASE
-
- 0.9.0.RELEASE
-
- 1.1.3
-
-
-
-
- com.gitee.sop
- sop-service-common
- 3.1.5-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
-
-
-
-
- com.alibaba.boot
- dubbo-spring-boot-starter
- 0.2.1.RELEASE
-
-
- com.alibaba
- dubbo
- ${dubbo.version}
-
-
- io.netty
- netty-all
-
-
-
-
- io.springfox
- springfox-swagger2
- 2.9.2
-
-
- com.github.xiaoymin
- swagger-bootstrap-ui
- 1.9.5
-
-
-
- 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.apache.maven.plugins
- maven-surefire-plugin
- 2.12.4
-
- true
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
-
-
-
-
-
-
- spring-milestones
- Spring Milestones
- https://repo.spring.io/milestone
-
-
-
-
diff --git a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/StoryController.java b/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/StoryController.java
deleted file mode 100644
index e7ed7976..00000000
--- a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/StoryController.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.gitee.sop.storyweb.controller;
-
-import com.gitee.sop.story.api.domain.Story;
-import com.gitee.sop.story.api.service.StoryService;
-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;
- }
-
-
-}
diff --git a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/StoryDemoController.java b/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/StoryDemoController.java
deleted file mode 100644
index b07e61fc..00000000
--- a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/StoryDemoController.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.gitee.sop.storyweb.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-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/service/DefaultDemoService.java b/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/service/DefaultDemoService.java
deleted file mode 100644
index 2929f9ed..00000000
--- a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/service/DefaultDemoService.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.gitee.sop.storyweb.service;
-
-import com.alibaba.dubbo.config.annotation.Service;
-import com.gitee.sop.story.api.param.DemoParam;
-import com.gitee.sop.story.api.result.DemoResult;
-import com.gitee.sop.story.api.service.DemoService;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Value;
-
-@Service(version = "1.0.0")
-@Slf4j
-public class DefaultDemoService implements DemoService {
-
- /**
- * The default value of ${dubbo.application.name} is ${spring.application.name}
- */
- @Value("${dubbo.application.name}")
- private String serviceName;
-
- public String sayHello(String name) {
- return String.format("[%s] : Hello, %s", serviceName, name);
- }
-
- @Override
- public DemoResult getStory(DemoParam param) {
- log.info("dubbo provider, param: {}", param);
- DemoResult demoResult = new DemoResult();
- demoResult.setId(param.getId());
- demoResult.setName("dubbo 白雪公主, param=" + param);
- return demoResult;
- }
-}
\ No newline at end of file
diff --git a/sop-example/sop-story/sop-story-web/src/main/resources/application.properties b/sop-example/sop-story/sop-story-web/src/main/resources/application.properties
deleted file mode 100644
index 257b3064..00000000
--- a/sop-example/sop-story/sop-story-web/src/main/resources/application.properties
+++ /dev/null
@@ -1 +0,0 @@
-spring.profiles.active=dev
\ No newline at end of file
diff --git a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/SopStoryApplication.java b/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/SopStoryApplication.java
similarity index 100%
rename from sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/SopStoryApplication.java
rename to sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/SopStoryApplication.java
diff --git a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/config/OpenServiceConfig.java b/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/config/OpenServiceConfig.java
similarity index 100%
rename from sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/config/OpenServiceConfig.java
rename to sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/config/OpenServiceConfig.java
diff --git a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/AlipayController.java b/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/AlipayController.java
similarity index 95%
rename from sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/AlipayController.java
rename to sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/AlipayController.java
index f7510610..8614540e 100644
--- a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/AlipayController.java
+++ b/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/AlipayController.java
@@ -6,7 +6,6 @@ import com.gitee.sop.servercommon.annotation.ApiAbility;
import com.gitee.sop.servercommon.annotation.ApiMapping;
import com.gitee.sop.servercommon.bean.OpenContext;
import com.gitee.sop.servercommon.bean.ServiceContext;
-import com.gitee.sop.story.api.domain.Story;
import com.gitee.sop.storyweb.controller.param.CategoryParam;
import com.gitee.sop.storyweb.controller.param.StoryParam;
import com.gitee.sop.storyweb.controller.result.CategoryResult;
@@ -291,17 +290,6 @@ public class AlipayController {
return new TreeResult();
}
- // 测试参数绑定,http://localhost:2222/story/getStory4?biz_content=%7b%22id%22%3a1%2c%22name%22%3a%22aaaa%22%7d
- @ApiAbility
- @GetMapping("getStory4")
- public StoryResult getStory4(Story param, P p2) {
- System.out.println(param + ", p2=" + p2);
- StoryResult result = new StoryResult();
- result.setId(1L);
- result.setName("海底小纵队(默认版本号)" + param + ", p2=" + p2);
- return result;
- }
-
@Data
public static class P {
private String name;
diff --git a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/AlipayController2.java b/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/AlipayController2.java
similarity index 100%
rename from sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/AlipayController2.java
rename to sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/AlipayController2.java
diff --git a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/DownloadController.java b/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/DownloadController.java
similarity index 100%
rename from sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/DownloadController.java
rename to sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/DownloadController.java
diff --git a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/FileUploadDemoController.java b/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/FileUploadDemoController.java
similarity index 100%
rename from sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/FileUploadDemoController.java
rename to sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/FileUploadDemoController.java
diff --git a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/JSR303DemoController.java b/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/JSR303DemoController.java
similarity index 100%
rename from sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/JSR303DemoController.java
rename to sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/JSR303DemoController.java
diff --git a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/PermissionDemoController.java b/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/PermissionDemoController.java
similarity index 94%
rename from sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/PermissionDemoController.java
rename to sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/PermissionDemoController.java
index ca830362..86321f14 100644
--- a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/PermissionDemoController.java
+++ b/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/PermissionDemoController.java
@@ -1,7 +1,6 @@
package com.gitee.sop.storyweb.controller;
import com.gitee.sop.servercommon.annotation.ApiMapping;
-import com.gitee.sop.story.api.domain.Story;
import com.gitee.sop.storyweb.controller.result.StoryResult;
import org.springframework.web.bind.annotation.RestController;
diff --git a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/PostJsonController.java b/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/PostJsonController.java
similarity index 63%
rename from sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/PostJsonController.java
rename to sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/PostJsonController.java
index 25ac667e..9ef28264 100644
--- a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/PostJsonController.java
+++ b/sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/PostJsonController.java
@@ -1,9 +1,8 @@
package com.gitee.sop.storyweb.controller;
import com.gitee.sop.servercommon.annotation.ApiMapping;
-import com.gitee.sop.servercommon.bean.ServiceContext;
import com.gitee.sop.servercommon.bean.OpenContext;
-import com.gitee.sop.story.api.domain.Story;
+import com.gitee.sop.servercommon.bean.ServiceContext;
import com.gitee.sop.storyweb.controller.param.StoryParam;
import com.gitee.sop.storyweb.controller.result.StoryResult;
import org.apache.commons.lang3.StringUtils;
@@ -39,25 +38,4 @@ public class PostJsonController {
return result;
}
- /**
- * 演示客户端使用json方式请求(application/json)
- * @param param
- * @return
- */
- @ApiMapping(value = "demo.post.json", version = "1.2")
- public Story postJson2(StoryParam param) {
- // 获取开放平台请求参数
- OpenContext openContext = ServiceContext.getCurrentContext().getOpenContext();
- List