Ver Fonte

feature: 服务级变更通知添加日志打印

mazq há 1 ano atrás
pai
commit
ecd3d925e4

+ 4 - 18
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/async/subscribe/PermissionServiceUpdateMessage.java

@@ -38,8 +38,6 @@ public class PermissionServiceUpdateMessage {
 
     @Autowired
     private DcucAuthConfig dcucAuthConfig;
-    @Autowired
-    private IServiceAuthResultService serviceAuthResultService;
 
     /**
      * 服务变更通知
@@ -57,18 +55,6 @@ public class PermissionServiceUpdateMessage {
         serviceChangeNoticeDto.setContents(dtoList);
         //服务变更通知
         sendMessage(serviceChangeNoticeDto);
-        for (AppServiceCodeDto appServiceCodeDto : dtoList) {
-            List<ServiceAuthResult> results = serviceAuthResultService.serviceAuthResultList(appServiceCodeDto.getAppCode());
-            if (StringUtils.isNotEmpty(appServiceCodeDto.getAppCode())) {
-                /*服务鉴权  */
-                List<ServiceAuthenticationResVO> serviceAuthenticationResVOS = new ArrayList<>();
-                results.forEach(item -> {
-                    ServiceAuthenticationResVO vo = new ServiceAuthenticationResVO();
-                    vo.setServiceCode(item.getServiceCode());
-                    serviceAuthenticationResVOS.add(vo);
-                });
-            }
-        }
     }
 
 
@@ -91,14 +77,14 @@ public class PermissionServiceUpdateMessage {
         //参数
         HttpEntity<ServiceChangeNoticeDto> httpEntity = new HttpEntity<>(dto, headers);
 
-        logger.info("Service permission update request body : {}", JSONUtil.toJsonStr(httpEntity));
+        logger.info("发送服务级权限变更通知, 通知内容 : {}", JSONUtil.toJsonStr(dto));
         try {
             ResponseMessage result = restTemplate.postForObject(dcucAuthConfig.getServicePermissionUrl(),
                     httpEntity, ResponseMessage.class);
-            //todo 是否要处理返回结果,增加重试次数
-            logger.info("Service permission update response: {} ", JsonUtils.toJSONString(result));
+
+            logger.info("服务级权限变更通知,返回结果: {} ", JsonUtils.toJSONString(result));
         } catch (Exception e) {
-            logger.error("PermissionUpdateService.sendMessage()请求失败:", e);
+            logger.error("服务级权限变更通知请求失败", e);
         }
     }