#1. 添加依赖
<dependency>
<groupId>com.github.alenfive</groupId>
<artifactId>rocket-api-boot-starter</artifactId>
<version>2.2.1.RELEASE</version>
</dependency>
#2. 数据源配置,继承com.github.alenfive.rocketapi.datasource.DataSourceManager
@Component
public class DefaultDataSourceManager extends DataSourceManager {
@Autowired
private JdbcTemplate jdbcTemplate;
@PostConstruct
public void init() {
Map<String,DataSourceDialect> dialects = new HashMap<>();
dialects.put("mysql",new MySQLDataSource(jdbcTemplate,true));
super.setDialectMap(dialects);
}
}
#3. 关系型数据库建表,非关系型不用
最新建表脚本查看: https://gitee.com/alenfive/rocket-api-doc/wikis/pages?sort_id=2670007&doc_id=859283
启动项目,访问地址: http://localhost:8080/interface-ui