feat(common): add API operation logging with AOP and trace ID tracking

This commit is contained in:
2025-11-26 20:08:48 +08:00
parent d689a39a98
commit 531d99b3df
11 changed files with 206 additions and 14 deletions

View File

@@ -0,0 +1,18 @@
package com.hanserwei.common.utils;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class JsonUtils {
private static final ObjectMapper INSTANCE = new ObjectMapper();
public static String toJsonString(Object obj) {
try {
return INSTANCE.writeValueAsString(obj);
} catch (JsonProcessingException e) {
return obj.toString();
}
}
}