소스 검색

feat: 增加日志

huangzqa 1 년 전
부모
커밋
9f4f258735

+ 6 - 8
dcuc-auth-service/src/main/java/com/dragoninfo/dcuc/auth/auth/business/impl/zerotrust/ZeroTrustFunAuthBusiness.java

@@ -1,18 +1,16 @@
 package com.dragoninfo.dcuc.auth.auth.business.impl.zerotrust;
 
 import cn.hutool.core.util.StrUtil;
-import com.dragoninfo.dcuc.auth.api.vo.zerotrust.FunctionAuthReqVO;
 import com.dragoninfo.dcuc.auth.api.enums.zerotrust.ZeroTrustBusinessRespEnum;
+import com.dragoninfo.dcuc.auth.api.vo.zerotrust.FunctionAuthReqVO;
 import com.dragoninfo.dcuc.auth.api.vo.zerotrust.ZeroTrustDataRespVO;
 import com.dragoninfo.dcuc.auth.audit.enums.AuthResultEnum;
 import com.dragoninfo.dcuc.auth.audit.service.log.LogInfoFillService;
 import com.dragoninfo.dcuc.auth.auth.business.zerotrust.IZeroTrustFunAuthBusiness;
 import com.dragoninfo.dcuc.auth.auth.dto.AppFunInfoDTO;
 import com.dragoninfo.dcuc.auth.auth.dto.RoleApiDto;
-import com.dragoninfo.dcuc.auth.auth.service.IApprovalService;
 import com.dragoninfo.dcuc.auth.auth.service.IRoleService;
 import com.dragoninfo.dcuc.auth.business.zerotrust.IApiCommonBusiness;
-import com.dragoninfo.dcuc.auth.business.zerotrust.IApproveRemoteCallBusiness;
 import com.dragoninfo.dcuc.auth.business.zerotrust.IAuthTokenBusiness;
 import com.dragoninfo.dcuc.auth.sub.vo.ApplyInfoVo;
 import com.dragoninfo.dcuc.auth.sub.vo.AuthUserVo;
@@ -73,7 +71,7 @@ public class ZeroTrustFunAuthBusiness implements IZeroTrustFunAuthBusiness {
         String appTokenId = functionAuthReqVO.getAppTokenId();
         TokenDetailRespVo tokenInfo = authTokenBusiness.getByAppTokenId(appTokenId, true, true);
         if (null == tokenInfo) {
-            log.error("查询不到令牌信息");
+            log.error("查询不到应用令牌信息:{}", appTokenId);
             return ZeroTrustDataRespVO.resultEnumMessage(ZeroTrustBusinessRespEnum.TOKEN_FAIL);
         }
 
@@ -86,7 +84,7 @@ public class ZeroTrustFunAuthBusiness implements IZeroTrustFunAuthBusiness {
         String taskId = functionAuthReqVO.getTaskId();
         ZeroTrustDataRespVO<String> checkTaskIdMessage = apiCommonBusiness.taskIdCheck(appTokenId, taskId);
         if (!checkTaskIdMessage.isRespSuccess()) {
-            log.error("==============任务信息校验失败===========");
+            log.error("==============任务信息校验失败:{}===========", taskId);
 
             // 发送鉴权失败日志
             logInfoFillService.sendFunAuthenticationLog(AuthResultEnum.FAIL, roleApiDto, Collections.emptyList(),
@@ -96,7 +94,7 @@ public class ZeroTrustFunAuthBusiness implements IZeroTrustFunAuthBusiness {
         }
 
         if (userInfo == null) {
-            log.error("查询不到用户信息");
+            log.error("查询不到用户信息:{}", tokenInfo.getUserToken().getPid());
             // 发送鉴权失败日志
             logInfoFillService.sendFunAuthenticationLog(AuthResultEnum.FAIL, roleApiDto, Collections.emptyList(),
                     IpUtils.getRealIpAdrress(RequestUtils.getRequest()),
@@ -111,7 +109,7 @@ public class ZeroTrustFunAuthBusiness implements IZeroTrustFunAuthBusiness {
 
         ApplyInfoVo applyInfo = tokenInfo.getApplyInfo();
         if (ObjectUtils.isEmpty(applyInfo)) {
-            log.error("应用不存在");
+            log.error("应用不存在:{}", tokenInfo.getAppToken().getAppId());
             // 发送鉴权失败日志
             logInfoFillService.sendFunAuthenticationLog(AuthResultEnum.FAIL, roleApiDto, Collections.emptyList(),
                     IpUtils.getRealIpAdrress(RequestUtils.getRequest()),
@@ -119,7 +117,7 @@ public class ZeroTrustFunAuthBusiness implements IZeroTrustFunAuthBusiness {
             return ZeroTrustDataRespVO.resultEnumMessage(ZeroTrustBusinessRespEnum.OPERATE_FAIL);
         }
         if (BooleanEnum.TRUE.getValue().equals(applyInfo.getApplyStatus())) {
-            log.error("应用已停用");
+            log.error("应用已停用:{},状态:{}", applyInfo.getApplyCode(), applyInfo.getApplyStatus());
             // 发送鉴权失败日志
             logInfoFillService.sendFunAuthenticationLog(AuthResultEnum.FAIL, roleApiDto, Collections.emptyList(),
                     IpUtils.getRealIpAdrress(RequestUtils.getRequest()),