阅读 194

rocket-api

rocket-api

"Rocket-API" 基于spring boot 的API敏捷开发框架

 

添加依赖:

        <dependency>
            <groupId>com.github.alenfive</groupId>
            <artifactId>rocket-api-boot-starter</artifactId>
            <version>2.3.7.RELEASE</version>
        </dependency>

 

Rocket-API的数据源配置:

复制代码

@Componentpublic class DefaultDataSourceManager extends DataSourceManager {

    @Autowired    private JdbcTemplate jdbcTemplate;

    @PostConstruct    public void init() {

        Map<String, DataSourceDialect> dialects = new HashMap<>();        //通过MysqlDataSource的第二个参数为`true`来表示生成的API信息所存储的库,有且仅有一个为true
        dialects.put("mysql",new MySQLDataSource(jdbcTemplate,true));        super.setDialectMap(dialects);
    }
}

复制代码

 

yml配置:

复制代码

spring:
  application:
    name: rocket-api-demo
  datasource:
    url: jdbc:mysql://127.0.0.1:3306/dataway2?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
    username: root
    password: 123456
    driver-class-name: com.mysql.cj.jdbc.Driver
  rocket-api:
    base-register-path: /interface-ui #基础API注册路径,默认值为/interface-ui
    secret-key: 123456 #远程部署密钥,默认为:123456789
    config-enabled: true #开启页面配置功能
    view-enabled: true #不启用UI控制界面/interface-ui, 用于生产环境的安全性控制,默认为 true
    sync-enabled: false #不接受远程部署,用于拒绝其他服务向本服务发布接口,默认为 true  ,对应功能 "页面操作"-> "远程发布"
    map-underscore-to-camel-case: true #驼峰自动转换配置, 默认true

复制代码

 

创建接口:

 

 

官网:

https://gitee.com/alenfive/rocket-api

服务器评测 http://www.cncsto.com/ 

服务器测评 http://www.cncsto.com/ 


文章分类
后端
文章标签
版权声明:本站是系统测试站点,无实际运营。本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 XXXXXXo@163.com 举报,一经查实,本站将立刻删除。
相关推荐