ApiBoot
是一款基于SpringBoot1.x
,SpringBoot2.x
的接口服务集成基础框架
,内部提供了框架的封装集成
、使用扩展
、自动化配置
等,让接口开发者可以选着性完成开箱即用,不再为搭建接口框架而犯愁,从而极大的提高开发效率。
1.数据库表数据实体自动生成
package org.minbox.framework.api.boot.sample;
import com.gitee.hengboy.mybatis.enhance.common.annotation.Column;
import com.gitee.hengboy.mybatis.enhance.common.annotation.Id;
import com.gitee.hengboy.mybatis.enhance.common.annotation.Table;
import com.gitee.hengboy.mybatis.enhance.common.enums.KeyGeneratorTypeEnum;
import lombok.Data;
import java.sql.Timestamp;
/**
* 文章信息表
* @author ApiBoot Mybatis Enhance Codegen
*/
@Data
@Table(name = "kl_article_info")
public class KlArticleInfo {
/**
* 主键自增
*/
@Id(generatorType = KeyGeneratorTypeEnum.UUID)
@Column(name = "AI_ID")
private String aiId;
/**
* 文章所属用户
*/
@Column(name = "AI_USER_ID")
private String aiUserId;
/**
* 文章标题
*/
@Column(name = "AI_TITLE")
private String aiTitle;
//...省略其他字段
}
2.数据库表动态查询实体自动生成
package org.minbox.framework.api.boot.sample;
import com.gitee.hengboy.mybatis.enhance.dsl.expression.ColumnExpression;
import com.gitee.hengboy.mybatis.enhance.dsl.expression.TableExpression;
/**
* 文章信息表
* @author ApiBoot Mybatis Enhance Codegen
*/
public class DKlArticleInfo extends TableExpression<KlArticleInfo> {
public DKlArticleInfo(String root) {
super(root);
}
public static DKlArticleInfo DSL() {
return new DKlArticleInfo("kl_article_info");
}
/**
* 主键自增
*/
public ColumnExpression aiId = new ColumnExpression("AI_ID", this);
/**
* 文章所属用户
*/
public ColumnExpression aiUserId = new ColumnExpression("AI_USER_ID", this);
/**
* 文章标题
*/
public ColumnExpression aiTitle = new ColumnExpression("AI_TITLE", this);
// ... 省略其他字段
}
3.like语法过滤指定表生成实体
<tableNamePattern>kl%</tableNamePattern>
可以使用like
语法指定kl
开头的表进行自动生成对应数据实体。
GitHub Wiki:https://github.com/hengboy/api-boot/wiki 码云 Wiki:https://gitee.com/hengboy/api-boot/wikis
ApiBoot
提供的所有封装依赖对应第三方框架关系如下所示:
依赖名称 | 介绍 |
---|---|
api-boot-starter | 所有Starter的基础依赖 |
api-boot-starter-http-converter | 集成FastJson作为格式化返回JSON |
api-boot-starter-security-oauth-jwt | 集成SpringSecurity、Oauth、Jwt安全、认证框架 |
api-boot-starter-swagger | 集成Swagger2作为接口服务文档 |
api-boot-starter-alibaba-oss | 集成阿里云Oss对象存储接口服务 |
api-boot-starter-alibaba-sms | 集成阿里云国际短信接口服务 |
api-boot-starter-quartz | 集成分布式定时任务框架Quartz |
api-boot-starter-datasource-switch | 集成支持多数据源自动切换、动态创建数据源 |
api-boot-starter-resource-load | 资源与业务完全分离、自动化读取 |
api-boot-starter-message-push | 推送服务,集成极光推送 |
api-boot-starter-rate-limiter | 接口QPS限流 |
api-boot-starter-mybatis-enhance | 集成Myabtis Enhance 持久化框架 |
api-boot-starter-mybatis-pageable | 集成Mybatis Pageable 自动分页插件 |
api-boot-mybatis-enhance-maven-codegen | Mybatis Enhance专属代码插件 |