2025-06-11 14:45:40 +08:00
|
|
|
|
package com.yupi.springbootinit;
|
|
|
|
|
|
|
|
|
|
|
|
import org.mybatis.spring.annotation.MapperScan;
|
|
|
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
|
|
|
|
|
|
import org.springframework.context.annotation.EnableAspectJAutoProxy;
|
|
|
|
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
|
|
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 主类(项目启动入口)
|
|
|
|
|
|
*
|
|
|
|
|
|
* @author <a href="https://github.com/liyupi">程序员鱼皮</a>
|
|
|
|
|
|
* @from <a href="https://yupi.icu">编程导航知识星球</a>
|
|
|
|
|
|
*/
|
|
|
|
|
|
// todo 如需开启 Redis,须移除 exclude 中的内容
|
2025-06-16 14:30:20 +08:00
|
|
|
|
@SpringBootApplication()
|
2025-06-11 14:45:40 +08:00
|
|
|
|
@MapperScan("com.yupi.springbootinit.mapper")
|
|
|
|
|
|
@EnableScheduling
|
|
|
|
|
|
@EnableTransactionManagement
|
|
|
|
|
|
@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
|
|
|
|
|
|
public class MainApplication {
|
2025-06-11 18:19:40 +08:00
|
|
|
|
static {
|
|
|
|
|
|
// 在静态块中最早设置
|
|
|
|
|
|
org.apache.ibatis.logging.LogFactory.useNoLogging();
|
|
|
|
|
|
}
|
2025-06-11 14:45:40 +08:00
|
|
|
|
public static void main(String[] args) {
|
2025-06-11 18:19:40 +08:00
|
|
|
|
org.apache.ibatis.logging.Log log =
|
|
|
|
|
|
org.apache.ibatis.logging.LogFactory.getLog(MainApplication.class);
|
|
|
|
|
|
System.out.println("当前MyBatis日志实现: " + log.getClass().getName());
|
2025-06-11 14:45:40 +08:00
|
|
|
|
SpringApplication.run(MainApplication.class, args);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|