huodongdong vor 6 Jahren
Ursprung
Commit
c635cbc670

+ 2 - 0
rankin-api-web/src/main/java/cn/rankin/apiweb/service/auth/AuthService.java

@@ -6,6 +6,7 @@ import cn.rankin.data.api.auth.vo.AuthResult;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import com.alibaba.fastjson.JSON;
 
 @Service
 @Slf4j
@@ -21,6 +22,7 @@ public class AuthService{
         authDTO.setUserId(userId);
         authDTO.setMerchantId(merchantId);
         APIResult<AuthResult> apiResult = authClient.auth(authDTO);
+        log.info("auth api result: {}", JSON.toJSONString(apiResult));
         return apiResult;
     }
 

+ 2 - 2
rankin-data-api/src/main/java/cn/rankin/data/api/auth/vo/AuthResult.java

@@ -22,7 +22,7 @@ public class AuthResult implements Serializable {
 
     public Long getValidTime() {
         if (startTime == null || endTime == null) {
-            return null;
+            return 0L;
         }
         return endTime - startTime;
     }
@@ -35,6 +35,6 @@ public class AuthResult implements Serializable {
         if (validTime == null) {
             return Boolean.FALSE;
         }
-        return getValidTime() > 0;
+        return getValidTime() > 0L;
     }
 }