Files
brick-common-core/ai/conventions.md
T
yangzhaohan c302175f03 first commit
2026-06-22 15:50:44 +08:00

31 lines
663 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# brick-common-core 编码规范
## 职责边界
core 模块是项目的「底座」,提供所有模块共享的基础设施:
- 项目级常量(`BrickConstants`
- 公共异常基类
- 通用工具类
core 模块**不包含**业务逻辑,不依赖其他业务模块。
## 使用准则
- 需要全项目共享的常量、工具,放在 core 模块。
- 不要将仅单个模块使用的类放在 core——应放在对应模块内。
## 正例
```java
// 通过 BrickConstants 引用公共常量
String charset = BrickConstants.DEFAULT_CHARSET;
```
## 反例
```java
// 魔法字符串散落在各处
byte[] bytes = str.getBytes("UTF-8");
```