package xtools.boot.web.base.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.converter.Converter;
import xtools.boot.core.utils.TimeUtils;

import java.time.Instant;

/**
 * <p>Title : MvcConverterConfig</p>
 * <p>Description : MvcConverterConfig</p>
 * <p>DevelopTools : Idea_x64_v2026.1</p>
 * <p>DevelopSystem : macOS Sequoia 15.7.5</p>
 * <p>Company : org.xujun</p>
 *
 * @author : XuJun
 * @version : 5.0.0
 * @date : 2026/1/6 14:44
 */
@Configuration
public class MvcConverterConfig {

    /**
     * 字符串转时间戳
     *
     * @return 转换器
     */
    @Bean
    public Converter<String, Instant> stringToInstantConverter() {
        return TimeUtils::toInstant;
    }

}
