feat(crm): add person, identity, conversation, tag tables and APIs

This commit is contained in:
2026-07-07 12:06:19 +08:00
parent 855f77595d
commit 3f2c0d7d16
34 changed files with 1086 additions and 1 deletions

View File

@@ -0,0 +1,38 @@
package com.sino.mci.shared.util;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public final class JsonUtils {
private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper();
private JsonUtils() {
}
public static String toJson(Object value) {
if (value == null) {
return null;
}
try {
return OBJECT_MAPPER.writeValueAsString(value);
} catch (JsonProcessingException e) {
log.warn("JSON serialize failed", e);
return null;
}
}
public static <T> T fromJson(String json, Class<T> clazz) {
if (json == null || json.isBlank()) {
return null;
}
try {
return OBJECT_MAPPER.readValue(json, clazz);
} catch (JsonProcessingException e) {
log.warn("JSON deserialize failed", e);
return null;
}
}
}