处理部分接口忽略日志记录

This commit is contained in:
yangsb
2024-04-03 11:15:37 +08:00
parent 0ff00b0801
commit e08dc9324c
6 changed files with 12 additions and 6 deletions
@@ -63,6 +63,7 @@ public class FileController {
@PermitAll
@Operation(summary = "下载文件")
@Parameter(name = "configId", description = "配置编号", required = true)
@OperateLog(enable = false)
public void getFileContent(HttpServletRequest request,
HttpServletResponse response,
@PathVariable("configId") Long configId) throws Exception {
@@ -8,7 +8,6 @@ import com.cf.imes.module.infra.dal.dataobject.logger.ApiErrorLogDO;
import com.cf.imes.module.infra.dal.mysql.logger.ApiErrorLogMapper;
import com.cf.imes.module.infra.enums.logger.ApiErrorLogProcessStatusEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
@@ -36,11 +35,7 @@ public class ApiErrorLogServiceImpl implements ApiErrorLogService {
public void createApiErrorLog(ApiErrorLogCreateReqDTO createDTO) {
ApiErrorLogDO apiErrorLog = BeanUtils.toBean(createDTO, ApiErrorLogDO.class)
.setProcessStatus(ApiErrorLogProcessStatusEnum.INIT.getStatus());
try {
apiErrorLogMapper.insert(apiErrorLog);
}catch (DataIntegrityViolationException e) {
log.error(apiErrorLog.toString());
}
apiErrorLogMapper.insert(apiErrorLog);
}
@Override