update - 调整API 及 Service 日志记录

This commit is contained in:
wangli 2024-04-07 11:33:05 +08:00
parent c5df82ee22
commit 16378bd8b2

View File

@ -2,7 +2,7 @@ package cn.axzo.workflow.core.common.event;
import cn.axzo.workflow.core.repository.entity.ExtAxApiLog;
import cn.axzo.workflow.core.service.ExtAxApiLogService;
import com.alibaba.fastjson.JSON;
import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.scheduling.annotation.Async;
@ -39,8 +39,8 @@ public class ApiLogListener implements ApplicationListener<ApiLogEvent> {
ExtAxApiLog apiLog = new ExtAxApiLog();
apiLog.setTraceId(event.getTraceId());
apiLog.setApiUrl(event.getApiUrl());
apiLog.setRequestBody(JSON.toJSONString(event.getRequestBody()));
apiLog.setResponseBody(JSON.toJSONString(event.getResponseBody()));
apiLog.setRequestBody(JSONUtil.toJsonStr(event.getRequestBody()));
apiLog.setResponseBody(JSONUtil.toJsonStr(event.getResponseBody()));
apiLog.setTakeTime(event.getTakeTime());
apiLog.setType(event.getType());
apiLogService.insert(apiLog);