Jiarenxiang | 25a45b7 | 2025-03-13 16:09:13 +0800 | [diff] [blame] | 1 | package com.ruoyi; |
| 2 | |
崔向南 | 03d21b9 | 2025-06-05 17:42:23 +0800 | [diff] [blame] | 3 | import org.mybatis.spring.annotation.MapperScan; |
Jiarenxiang | 25a45b7 | 2025-03-13 16:09:13 +0800 | [diff] [blame] | 4 | import org.springframework.boot.SpringApplication; |
| 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| 6 | import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; |
Jiarenxiang | b1f77ac | 2025-06-08 14:08:25 +0800 | [diff] [blame^] | 7 | import org.springframework.boot.web.server.ConfigurableWebServerFactory; |
| 8 | import org.springframework.boot.web.server.ErrorPage; |
| 9 | import org.springframework.boot.web.server.WebServerFactoryCustomizer; |
| 10 | import org.springframework.context.annotation.Bean; |
崔向南 | 03d21b9 | 2025-06-05 17:42:23 +0800 | [diff] [blame] | 11 | import org.springframework.context.annotation.ComponentScan; |
Jiarenxiang | 25a45b7 | 2025-03-13 16:09:13 +0800 | [diff] [blame] | 12 | |
| 13 | /** |
| 14 | * 启动程序 |
| 15 | * |
| 16 | * @author ruoyi |
| 17 | */ |
Jiarenxiang | 5f4247d | 2025-06-06 18:10:35 +0800 | [diff] [blame] | 18 | |
崔向南 | 03d21b9 | 2025-06-05 17:42:23 +0800 | [diff] [blame] | 19 | @ComponentScan(basePackages = { |
| 20 | "com.ruoyi", |
| 21 | "bounty" // 新增您的包路径 |
| 22 | }) |
| 23 | // 关键添加:扩大MyBatis接口扫描范围 |
| 24 | @MapperScan(basePackages = { |
| 25 | "com.ruoyi.**.mapper", |
Jiarenxiang | 5f4247d | 2025-06-06 18:10:35 +0800 | [diff] [blame] | 26 | "bounty.mapper", |
| 27 | "com.ruoyi.web.dao.BT", |
| 28 | "com.ruoyi.web.dao.sys" |
崔向南 | 03d21b9 | 2025-06-05 17:42:23 +0800 | [diff] [blame] | 29 | }) |
| 30 | |
Jiarenxiang | 25a45b7 | 2025-03-13 16:09:13 +0800 | [diff] [blame] | 31 | @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class }) |
Yumaoo | e96c254 | 2025-05-13 17:11:01 +0800 | [diff] [blame] | 32 | public class RuoYiApplication { |
| 33 | public static void main(String[] args) { |
Jiarenxiang | 5f4247d | 2025-06-06 18:10:35 +0800 | [diff] [blame] | 34 | |
Jiarenxiang | 25a45b7 | 2025-03-13 16:09:13 +0800 | [diff] [blame] | 35 | // System.setProperty("spring.devtools.restart.enabled", "false"); |
| 36 | SpringApplication.run(RuoYiApplication.class, args); |
| 37 | // ANSI escape code for blue text |
| 38 | String blue = "\u001B[34m"; |
| 39 | // ANSI escape code to reset text color |
| 40 | String reset = "\u001B[0m"; |
| 41 | |
Jiarenxiang | 5f4247d | 2025-06-06 18:10:35 +0800 | [diff] [blame] | 42 | System.out.println(blue + " ----我爱雨滔身体好好 喵喵 喵 喵" + reset); |
Jiarenxiang | 25a45b7 | 2025-03-13 16:09:13 +0800 | [diff] [blame] | 43 | } |
Jiarenxiang | b1f77ac | 2025-06-08 14:08:25 +0800 | [diff] [blame^] | 44 | |
| 45 | @Bean |
| 46 | public WebServerFactoryCustomizer<ConfigurableWebServerFactory> webServerFactoryCustomizer() { |
| 47 | return factory -> { |
| 48 | ErrorPage error404Page = new ErrorPage("/index.html"); |
| 49 | factory.addErrorPages(error404Page); |
| 50 | }; |
| 51 | } |
Jiarenxiang | 25a45b7 | 2025-03-13 16:09:13 +0800 | [diff] [blame] | 52 | } |