浏览代码

代码优化

zhoutg 6 年之前
父节点
当前提交
79fd4da37c

+ 1 - 1
icssman-service/src/main/java/com/diagbot/config/security/UrlAccessDecisionManager.java

@@ -48,7 +48,7 @@ public class UrlAccessDecisionManager implements AccessDecisionManager {
 //                tokenStr = tokenStr.replaceFirst("Bearer ", "");
 //                token.setToken(tokenStr);
 //                RespDTO<Boolean> res = userServiceClient.verifyToken(token);
-//                if (res == null || !"0".equals(res.code)) {
+//                if (res == null || !CommonErrorCode.OK.getCode()(res.code)) {
 //                    throw new AccountExpiredException("token expire");
 //                }
 //                if (!res.data) {

+ 1 - 1
icssman-service/src/main/java/com/diagbot/facade/DisclaimerInformationFacaed.java

@@ -58,7 +58,7 @@ public class DisclaimerInformationFacaed extends DisclaimerInformationServiceImp
         Map<String, String> userNames = new HashMap<>();
         if (modifierid.size() > 0) {
             RespDTO<Map<String, String>> userNamesDTO = userServiceClient.getUserInfoByIds(modifierid);
-            if (userNamesDTO == null || !"0".equals(userNamesDTO.code)) {
+            if (userNamesDTO == null || !CommonErrorCode.OK.getCode().equals(userNamesDTO.code)) {
                 throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
                         "获取所有用户信息失败");
             }

+ 1 - 1
icssman-service/src/main/java/com/diagbot/facade/QuestionInfoFacade.java

@@ -369,7 +369,7 @@ public class QuestionInfoFacade extends QuestionInfoServiceImpl {
         }
         List<String> personIds = res.getRecords().stream().map(row -> row.getModifier()).collect(Collectors.toList());
         RespDTO<Map<String, String>> mapRespDTO = userServiceClient.getUserInfoByIds(personIds);
-        if (mapRespDTO == null || !"0".equals(mapRespDTO.code)) {
+        if (mapRespDTO == null || !CommonErrorCode.OK.getCode().equals(mapRespDTO.code)) {
             throw new CommonException(CommonErrorCode.RPC_ERROR, "获取操作人失败");
         }
         for (QuestionPageDTO bean : res.getRecords()) {

+ 1 - 1
icssman-service/src/main/java/com/diagbot/facade/QuestionUsualFacade.java

@@ -162,7 +162,7 @@ public class QuestionUsualFacade extends QuestionUsualServiceImpl {
             ids.add(getDeptInfoDTO.getModifier());
         }
         RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(ids);
-        if (respDTO == null || !"0".equals(respDTO.code)) {
+        if (respDTO == null || !CommonErrorCode.OK.getCode().equals(respDTO.code)) {
             throw new CommonException(CommonErrorCode.RPC_ERROR,
                     "获取用户信息失败");
         }

+ 1 - 1
icssman-service/src/main/java/com/diagbot/facade/VersionDetailFacade.java

@@ -99,7 +99,7 @@ public class VersionDetailFacade extends VersionDetailServiceImpl {
         Map<String, String> userNames = new HashMap<>();
         if (modifierid.size() > 0) {
             RespDTO<Map<String, String>> userNamesDTO = userServiceClient.getUserInfoByIds(modifierid);
-            if (userNamesDTO == null || !"0".equals(userNamesDTO.code)) {
+            if (userNamesDTO == null || !CommonErrorCode.OK.getCode().equals(userNamesDTO.code)) {
                 throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
                         "获取所有用户信息失败");
             }

+ 1 - 1
icssman-service/src/main/java/com/diagbot/facade/VersionInfoFacade.java

@@ -73,7 +73,7 @@ public class VersionInfoFacade extends VersionInfoServiceImpl {
         Map<String, String> userNames = new HashMap<>();
         if (modifierid.size() > 0) {
             RespDTO<Map<String, String>> userNamesDTO = userServiceClient.getUserInfoByIds(modifierid);
-            if (userNamesDTO == null || !"0".equals(userNamesDTO.code)) {
+            if (userNamesDTO == null || !CommonErrorCode.OK.getCode().equals(userNamesDTO.code)) {
                 throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "获取所有用户信息失败");
             }
             userNames = userNamesDTO.data;