REQ-3300: 加入是否记录请求的开关

This commit is contained in:
yanglin 2025-02-27 18:34:20 +08:00
parent d021497652
commit 8e099c4502

View File

@ -1,6 +1,8 @@
package cn.axzo.nanopart.ess.server.dao;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@ -12,10 +14,15 @@ import cn.axzo.nanopart.ess.server.utils.BizAssertions;
/**
* @author yanglin
*/
@RefreshScope
@Repository("essLogDao")
public class EssLogDao extends ServiceImpl<EssLogMapper, EssLog> {
@Value("${ess.enableRequestLog:true}")
private boolean enableRequestLog;
public void logRequest(String context, Object subject, Object request) {
if (enableRequestLog)
log(context, subject, "request", request);
}