|
@@ -1,19 +1,35 @@
|
|
package com.ygj.yuemum;
|
|
package com.ygj.yuemum;
|
|
|
|
|
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
import org.mybatis.spring.annotation.MapperScan;
|
|
import org.mybatis.spring.annotation.MapperScan;
|
|
import org.springframework.boot.SpringApplication;
|
|
import org.springframework.boot.SpringApplication;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
|
+import org.springframework.context.annotation.Bean;
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
|
|
|
|
|
+import java.util.Properties;
|
|
|
|
+
|
|
@SpringBootApplication
|
|
@SpringBootApplication
|
|
@MapperScan("com.ygj.yuemum.dao")
|
|
@MapperScan("com.ygj.yuemum.dao")
|
|
@EnableScheduling
|
|
@EnableScheduling
|
|
-public class YueMumApplication {
|
|
|
|
|
|
+public class YueMumApplication {
|
|
|
|
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
SpringApplication.run(YueMumApplication.class, args);
|
|
SpringApplication.run(YueMumApplication.class, args);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Bean
|
|
|
|
+ public PageHelper pageHelper() {
|
|
|
|
+ PageHelper pageHelper = new PageHelper();
|
|
|
|
+ Properties properties = new Properties();
|
|
|
|
+ properties.setProperty("offsetAsPageNum", "true");
|
|
|
|
+ properties.setProperty("rowBoundsWithCount", "true");
|
|
|
|
+ properties.setProperty("reasonable", "true");
|
|
|
|
+ properties.setProperty("dialect", "mysql"); //配置mysql数据库的方言
|
|
|
|
+ pageHelper.setProperties(properties);
|
|
|
|
+ return pageHelper;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
//public class YueMumApplication extends SpringBootServletInitializer implements WebApplicationInitializer {
|
|
//public class YueMumApplication extends SpringBootServletInitializer implements WebApplicationInitializer {
|
|
//
|
|
//
|
|
@@ -26,4 +42,15 @@ public class YueMumApplication {
|
|
// public static void main(String[] args) {
|
|
// public static void main(String[] args) {
|
|
// SpringApplication.run(YueMumApplication.class, args);
|
|
// SpringApplication.run(YueMumApplication.class, args);
|
|
// }
|
|
// }
|
|
|
|
+// @Bean
|
|
|
|
+// public PageHelper pageHelper() {
|
|
|
|
+// PageHelper pageHelper = new PageHelper();
|
|
|
|
+// Properties properties = new Properties();
|
|
|
|
+// properties.setProperty("offsetAsPageNum", "true");
|
|
|
|
+// properties.setProperty("rowBoundsWithCount", "true");
|
|
|
|
+// properties.setProperty("reasonable", "true");
|
|
|
|
+// properties.setProperty("dialect", "mysql"); //配置mysql数据库的方言
|
|
|
|
+// pageHelper.setProperties(properties);
|
|
|
|
+// return pageHelper;
|
|
|
|
+// }
|
|
//}
|
|
//}
|