优化性能

pull/10/MERGE
tanghc 4 years ago
parent 5d00092cc5
commit 91f8c82f0e
  1. 5
      pom.xml
  2. 2
      sop-example/sop-story/src/main/java/com/gitee/sop/storyweb/controller/Example1001_BaseController.java
  3. 8
      sop-gateway/src/main/java/com/gitee/sop/gateway/interceptor/MyRouteInterceptor.java
  4. 2
      sop-test/src/test/java/com/gitee/sop/test/AllInOneTest.java

@ -73,6 +73,11 @@
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.projectreactor.netty</groupId>
<artifactId>reactor-netty</artifactId>
<version>0.8.19.RELEASE</version>
</dependency>
<!-- 加了这个就不需要加版本号了 -->
<dependency>
<groupId>org.springframework.boot</groupId>

@ -152,7 +152,7 @@ public class Example1001_BaseController {
// 忽略验证
@ApiOperation(value = "忽略签名验证", notes = "忽略签名验证")
@Open(value = "story.get.ignore", ignoreValidate = true)
@PostMapping(value = "/get/ignore/v1")
@RequestMapping(value = "/get/ignore/v1")
public StoryResult getStory21(@RequestBody StoryParam story) {
StoryResult result = new StoryResult();
result.setId((long) story.getId());

@ -5,6 +5,9 @@ import com.gitee.sop.gatewaycommon.interceptor.RouteInterceptorContext;
import com.gitee.sop.gatewaycommon.param.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;
import java.net.URI;
/**
* 演示拦截器
@ -18,7 +21,10 @@ public class MyRouteInterceptor implements RouteInterceptor {
@Override
public void preRoute(RouteInterceptorContext context) {
ApiParam apiParam = context.getApiParam();
log.info("请求接口:{}, request_id:{}, app_id:{}, ip:{}",
ServerWebExchange exchange = (ServerWebExchange) context.getRequestContext();
URI uri = exchange.getRequest().getURI();
log.info("请求URL:{}, 请求接口:{}, request_id:{}, app_id:{}, ip:{}",
uri,
apiParam.fetchNameVersion(),
apiParam.fetchRequestId(),
apiParam.fetchAppKey(),

@ -102,7 +102,7 @@ public class AllInOneTest extends TestBase {
.version("1.0")
.ignoreSign(true)
.bizContent(new BizContent().add("id", "222").add("name", "忽略222"))
.httpMethod(HttpTool.HTTPMethod.POST);
.httpMethod(HttpTool.HTTPMethod.GET);
client.execute(requestBuilder);
}

Loading…
Cancel
Save