package com.bc.exam;

import com.bc.exam.core.api.utils.JsonConverter;
import lombok.extern.log4j.Log4j2;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

/**
 * @Description 描述:springboot 系统启动
 * @Author A贾宇婷034244310
 * @Date 20260615
 */
@Log4j2
@SpringBootApplication
@EnableTransactionManagement
public class ExamApplication implements WebMvcConfigurer {

	public static void main(String[] args) {
		log.info("\n----------------------------------------------------------\n\t" +
				"系统启动成功，访问路径如下:\n\t" +
				"本地路径: \t\thttp://127.0.0.1:8101/\n\t"+
				"API文档: \t\thttp://127.0.0.1:8101/doc.html\n\t" +
				"----------------------------------------------------------");
	}

	@Override
	public void extendMessageConverters(List<HttpMessageConverter<?>> converters) {
		//保留原有converter,把新增fastConverter插入集合头,保证优先级
		converters.add(0, JsonConverter.fastConverter());
	}

}