package com.usky.issue.service.util;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;

/**
 * 同步模块 JSON 序列化（支持 LocalDateTime 等 Java 8 时间类型）
 *
 * @author fyc
 * @date 2026-06-29
 */
public final class SyncJsonMapper {

    public static final ObjectMapper INSTANCE = create();

    private SyncJsonMapper() {
    }

    private static ObjectMapper create() {
        ObjectMapper mapper = new ObjectMapper();
        mapper.registerModule(new JavaTimeModule());
        mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
        return mapper;
    }
}
