mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-13 02:57:13 +08:00
refactor: 适配 ContiNew Starter 密码编码器(安全模块)、链路跟踪(Web 模块)
并适配 ContiNew Starter CRUD 模块包调整
This commit is contained in:
@@ -23,6 +23,7 @@ import top.charles7c.continew.admin.monitor.mapper.LogMapper;
|
||||
import top.charles7c.continew.admin.system.service.UserService;
|
||||
import top.charles7c.continew.starter.log.common.dao.LogDao;
|
||||
import top.charles7c.continew.starter.log.httptracepro.autoconfigure.ConditionalOnEnabledLog;
|
||||
import top.charles7c.continew.starter.web.autoconfigure.trace.TraceProperties;
|
||||
|
||||
/**
|
||||
* 日志配置
|
||||
@@ -38,7 +39,7 @@ public class LogConfiguration {
|
||||
* 日志持久层接口本地实现类
|
||||
*/
|
||||
@Bean
|
||||
public LogDao logDao(UserService userService, LogMapper logMapper) {
|
||||
return new LogDaoLocalImpl(userService, logMapper);
|
||||
public LogDao logDao(UserService userService, LogMapper logMapper, TraceProperties traceProperties) {
|
||||
return new LogDaoLocalImpl(userService, logMapper, traceProperties);
|
||||
}
|
||||
}
|
||||
|
@@ -38,6 +38,7 @@ import top.charles7c.continew.starter.log.common.dao.LogDao;
|
||||
import top.charles7c.continew.starter.log.common.model.LogRecord;
|
||||
import top.charles7c.continew.starter.log.common.model.LogRequest;
|
||||
import top.charles7c.continew.starter.log.common.model.LogResponse;
|
||||
import top.charles7c.continew.starter.web.autoconfigure.trace.TraceProperties;
|
||||
import top.charles7c.continew.starter.web.model.R;
|
||||
|
||||
import java.net.URI;
|
||||
@@ -56,6 +57,7 @@ public class LogDaoLocalImpl implements LogDao {
|
||||
|
||||
private final UserService userService;
|
||||
private final LogMapper logMapper;
|
||||
private final TraceProperties traceProperties;
|
||||
|
||||
@Async
|
||||
@Override
|
||||
@@ -88,7 +90,7 @@ public class LogDaoLocalImpl implements LogDao {
|
||||
logDO.setStatusCode(statusCode);
|
||||
Map<String, String> responseHeaders = logResponse.getHeaders();
|
||||
logDO.setResponseHeaders(JSONUtil.toJsonStr(responseHeaders));
|
||||
logDO.setTraceId(responseHeaders.get(SysConstants.TRACE_ID));
|
||||
logDO.setTraceId(responseHeaders.get(traceProperties.getHeaderName()));
|
||||
String responseBody = logResponse.getBody();
|
||||
logDO.setResponseBody(responseBody);
|
||||
// 状态
|
||||
|
Reference in New Issue
Block a user