逆向工程
需要修改的内容:
1、工程名字projectName,项目的绝对路径canonicalPath
2、修改数据库的用户名密码
3、修改包的名字 用GENERATOR.JAVA
private static String projectName = "article";
private static String canonicalPath = "F:\heima-leadnews\heima-leadnews-"+projectName;"
dsc.setDriverName("com.mysql.jdbc.Driver");
dsc.setUsername("root");
dsc.setPassword("123456");
dsc.setUrl("jdbc:mysql:///leadnews_"+projectName+"?useUnicode=true&characterEncoding=utf8");
mpg.setDataSource(dsc);
pc.setParent("com.heima."+projectName);// 自定义包路径
AdminApplication
driver-class-name: com.mysql.cj.jdbc.Driver
@SpringBootApplication
@MapperScan("com.heima.admin.mapper")
//@ComponentScan(basePackages = {"com.heima.admin","com.heima.common.exception"})
public class AdminApplication {
public static void main(String[] args) {
SpringApplication.run(AdminApplication.class, args);
}
@Bean
public MybatisPlusInterceptor interceptor(){
MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return mybatisPlusInterceptor;
}
}