Commit 197c4ad9bf159f6f3f08bf07cbdd14001f1e8b16

Authored by YunaiV
1 parent 48c976cf

【功能修复】INFRA:错误日志、访问日志,params 过长的问题

yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiAccessLogServiceImpl.java
1 1 package cn.iocoder.yudao.module.infra.service.logger;
2 2  
3   -import cn.hutool.core.util.StrUtil;
4 3 import cn.iocoder.yudao.framework.common.pojo.PageResult;
5 4 import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
  5 +import cn.iocoder.yudao.framework.common.util.string.StrUtils;
6 6 import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
7 7 import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
8 8 import cn.iocoder.yudao.module.infra.api.logger.dto.ApiAccessLogCreateReqDTO;
... ... @@ -35,8 +35,8 @@ public class ApiAccessLogServiceImpl implements ApiAccessLogService {
35 35 @Override
36 36 public void createApiAccessLog(ApiAccessLogCreateReqDTO createDTO) {
37 37 ApiAccessLogDO apiAccessLog = BeanUtils.toBean(createDTO, ApiAccessLogDO.class);
38   - apiAccessLog.setRequestParams(StrUtil.maxLength(apiAccessLog.getRequestParams(), REQUEST_PARAMS_MAX_LENGTH));
39   - apiAccessLog.setResultMsg(StrUtil.maxLength(apiAccessLog.getResultMsg(), RESULT_MSG_MAX_LENGTH));
  38 + apiAccessLog.setRequestParams(StrUtils.maxLength(apiAccessLog.getRequestParams(), REQUEST_PARAMS_MAX_LENGTH));
  39 + apiAccessLog.setResultMsg(StrUtils.maxLength(apiAccessLog.getResultMsg(), RESULT_MSG_MAX_LENGTH));
40 40 if (TenantContextHolder.getTenantId() != null) {
41 41 apiAccessLogMapper.insert(apiAccessLog);
42 42 } else {
... ...
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/logger/ApiErrorLogServiceImpl.java
1 1 package cn.iocoder.yudao.module.infra.service.logger;
2 2  
3   -import cn.hutool.core.util.StrUtil;
4 3 import cn.iocoder.yudao.framework.common.pojo.PageResult;
5 4 import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
  5 +import cn.iocoder.yudao.framework.common.util.string.StrUtils;
6 6 import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
7 7 import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
8 8 import cn.iocoder.yudao.module.infra.api.logger.dto.ApiErrorLogCreateReqDTO;
... ... @@ -39,7 +39,7 @@ public class ApiErrorLogServiceImpl implements ApiErrorLogService {
39 39 public void createApiErrorLog(ApiErrorLogCreateReqDTO createDTO) {
40 40 ApiErrorLogDO apiErrorLog = BeanUtils.toBean(createDTO, ApiErrorLogDO.class)
41 41 .setProcessStatus(ApiErrorLogProcessStatusEnum.INIT.getStatus());
42   - apiErrorLog.setRequestParams(StrUtil.maxLength(apiErrorLog.getRequestParams(), REQUEST_PARAMS_MAX_LENGTH));
  42 + apiErrorLog.setRequestParams(StrUtils.maxLength(apiErrorLog.getRequestParams(), REQUEST_PARAMS_MAX_LENGTH));
43 43 if (TenantContextHolder.getTenantId() != null) {
44 44 apiErrorLogMapper.insert(apiErrorLog);
45 45 } else {
... ...