SpringBoot环境(前后分离)
最后更新:2024-07-16 14:40:40
|
状态:未完成
前后分离的项目不需要依赖anyboot(anyboot中的包主要用来支持JSP)
-
添加依赖
<dependency> <groupId>org.anyline</groupId> <artifactId>anyline-environment-spring-data-jdbc</artifactId> <version>${anyline.version}</version> </dependency> <!-- Spring MVC 如果不需要web环境,那这个也不需要了--> <dependency> <groupId>org.anyline</groupId> <artifactId>anyline-mvc</artifactId> <version>${anyline.version}</version> </dependency> <!-- MySQL 根据实际情况,如果用到其他库一块加上 --> <dependency> <groupId>org.anyline</groupId> <artifactId>anyline-data-jdbc-mysql</artifactId> <version>${anyline.version}</version> </dependency> <!-- MySQL 官方驱动 --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency>
-
注入service @Autowired private org.anyline.service.AnylineService service 或者继承 org.anyline.controller.impl.AnylineController
其余操作于Srping MVC环境完全一致