first commit

This commit is contained in:
yangzhaohan
2026-06-22 15:50:44 +08:00
commit c302175f03
10 changed files with 176 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
# brick-common-core 编码规范
## 职责边界
core 模块是项目的「底座」,提供所有模块共享的基础设施:
- 项目级常量(`BrickConstants`
- 公共异常基类
- 通用工具类
core 模块**不包含**业务逻辑,不依赖其他业务模块。
## 使用准则
- 需要全项目共享的常量、工具,放在 core 模块。
- 不要将仅单个模块使用的类放在 core——应放在对应模块内。
## 正例
```java
// 通过 BrickConstants 引用公共常量
String charset = BrickConstants.DEFAULT_CHARSET;
```
## 反例
```java
// 魔法字符串散落在各处
byte[] bytes = str.getBytes("UTF-8");
```
+10
View File
@@ -0,0 +1,10 @@
module: core
summary: 核心基础模块,提供项目级常量与公共基类,所有其他模块均依赖此模块。
dos:
- 项目级常量统一通过 BrickConstants 访问,避免魔法值散落。
- 公共基类、工具类放在 core 模块,供其他模块复用。
donts:
- 不要在 core 模块中引入具体业务逻辑。
examples:
- path: src/main/java/{{basePkgPath}}/core/BrickConstants.java
note: 常量定义入口。