Explorar el Código

Merge branch 'master' of http://gogs.efunbox.cn:3000/Rankin/rankin

guozhaoshun hace 6 años
padre
commit
1a0aa5aa28

+ 18 - 0
rankin-api-web/src/main/java/cn/rankin/apiweb/controller/HeartBeatController.java

@@ -0,0 +1,18 @@
+package cn.rankin.apiweb.controller;
+
+
+import cn.rankin.common.utils.api.model.APIResult;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+public class HeartBeatController {
+
+    @RequestMapping(value = "/heartBeat", method = RequestMethod.GET)
+    public APIResult get(){
+        APIResult result = APIResult.ok();
+        result.setMessage("Beng Beng...");
+        return result;
+    }
+}

+ 10 - 2
rankin-api-web/src/main/java/cn/rankin/apiweb/intercepter/RequestSignatureInterceptor.java

@@ -62,16 +62,24 @@ public class RequestSignatureInterceptor implements HandlerInterceptor {
         //记录开始时间
         startTimeThreadLocal.set(System.currentTimeMillis());//线程绑定变量(该数据只有当前请求的线程可见)
 
+
         //登录请求不拦截
         String path = request.getServletPath();
+
         if (ignorePaths.contains(path) && (HttpMethod.POST.matches(request.getMethod()) ||
                 HttpMethod.PUT.matches(request.getMethod()))) {
-            logger.info("url: {} do not intercepted!");
+            logger.info("url: {} do not intercepted!, method={}", path, request.getMethod());
             return true;
         }
+        else if(path.endsWith("/heartBeat")){
+            //heartBeat请求不拦截
+            logger.info("url: {} do not intercepted!", path);
+            return true;
+        }
+
 
         GlobalHeader headers = RequestHeaderManager.parseHeader(request);
-        logger.info("request start, path={}, headers={}", path, JSON.toJSONString(headers));
+        logger.info("request start, path={}, method={}, headers={}", path, request.getMethod(), JSON.toJSONString(headers));
 
         String uid = headers.getUid();
         String sign = headers.getSign();

+ 4 - 0
rankin-api-web/src/main/resources/bootstrap.yml

@@ -7,5 +7,9 @@ spring:
       label: master
       profile: ${profile:dev}
 
+ribbon:
+  ReadTimeout: 6000
+  ConnectTimeout: 6000
+
 server:
   port: 8600