For Rachel Momo
- 教程:https://www.yuque.com/jiezizhu/r2mo
- 教程地图:https://kumu.io/LangYu1017/zero
- 示例:https://gitee.com/zero-ws/zero-rachel-momo
此库用于统一 spring-cloud / spring-boot 提供相对标准化的无业务脚手架,可快速开发和实施相关项目。
- 统一的 Json 数据结构类型
- Hutool 中的
JSONObject/JSONArray - Vertx 中的
JsonObject/JsonArray
- Hutool 中的
- 统一的 Io 存储对接访问(存储抽象隔离)
- 本地文件系统
- 🧪 FTP / SFTP
- 统一的异常处理架构
- Web 异常
- Remote 服务通信异常(Dubbo专用)
- Secure 安全异常(Security专用)
- 异常国际化支持
ResourceBundle - 🌟
VertxE / SpringE异常定义 -> 统一管理带有错误码的异常处理
- 统一的抽象数据层
- 标准化的
CRUD管理接口(具有幂等性的代码生成模型) - 🌟 JSON 语法的数据库查询分析引擎,简化查询,动态构造。
- Mybatis Plus
- 🧪 Jooq 实现
- 标准化的
- 快速编程 🌟
- 核心组件
CcCore Cache / 组件缓存架构:防止组件的重复创建Fn函数式编程接口,兼容 lambda 处理Checked异常R / WebRequest / WebResponse统一请求响应格式处理ActResponse统一服务级响应处理BuilderOf多元格式转换器,替换传统的Set/Get方法
- 核心工具
DBE/ Database Engine,提供数据库统一访问HFS/ High-Level File System,存储设备统一方法RFS/ Remote File System,基于底层抽象存储的上传下载HED/ High-Level Encrypt Decrypt,加解密专用工具类SPI/ Service Provider Interface,基于 SPI 的核心扩展,可直接使用
- 核心组件
- 快速测试框架
- JUnit 5
- Mockito
- 基于 Bouncy Castle 的增强安全算法 / 国密算法 🌟
- 许可管理全流程
- 数字签名
- 常用加密、解密核心算法统一接口
- 大文件上传下载
- 双容器模型
- Spring Boot 容器(包含 Security部分插件式引入)
- Vert.x 容器
部分实现模型只能二选一!
搭建经典的 -domain/-provider/-api 的结构,在父 POM 项目中直接继承(推荐)
<parent>
<groupId>io.zerows</groupId>
<artifactId>r2mo-rapid</artifactId>
<version>${r2mo.version}</version>
</parent>只有使用继承的方式可保证 Maven 的插件版本管理,若插件版本想自定义,直接追加 Maven 的依赖即可。
子项目 -domain 中引入
<dependencies>
<dependency>
<groupId>io.zerows</groupId>
<artifactId>r2mo-spring-boot</artifactId>
<version>${r2mo.version}</version>
</dependency>
<!--
实现部分:
- r2mo-spring-mybatisplus: Spring 的 MyBatis-Plus 实现
- r2mo-spring-json: Spring 的 Json 序列化配置实现
- r2mo-typed-hutool: 数据类型的统一实现(Hutool 的 JSONObject)
- r2mo-io-local: 存储的核心实现,本地文件存储
-->
<dependency>
<groupId>io.zerows</groupId>
<artifactId>r2mo-spring-mybatisplus</artifactId>
<version>${r2mo.version}</version>
</dependency>
<dependency>
<groupId>io.zerows</groupId>
<artifactId>r2mo-spring-json</artifactId>
<version>${r2mo.version}</version>
</dependency>
<dependency>
<groupId>io.zerows</groupId>
<artifactId>r2mo-typed-hutool</artifactId>
<version>${r2mo.version}</version>
</dependency>
<dependency>
<groupId>io.zerows</groupId>
<artifactId>r2mo-io-local</artifactId>
<version>${r2mo.version}</version>
</dependency>
</dependencies>上述方式是自选择实现的模式,若想要快速启动可使用如下依赖:
<dependencies>
<dependency>
<groupId>io.zerows</groupId>
<artifactId>r2mo-boot-spring-default</artifactId>
<version>${r2mo.version}</version>
</dependency>
</dependencies>
