mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-09 08:20:31 +08:00
bf20a13c96
Made-with: Cursor
21 lines
1.1 KiB
Markdown
21 lines
1.1 KiB
Markdown
# 07 `maven-cwos-resource` — 阿里巴巴规范走查(整理版)
|
||
|
||
**范围**:约 **494** 个 `*.java`;含 `cwos-java-sdk-resource`、portal/resource 接口与桩。
|
||
|
||
## 主要发现
|
||
|
||
| 严重度 | 说明 |
|
||
|--------|------|
|
||
| **高** | `RestPortalUserServiceImpl` 等大量方法 **`return null`** 且部分**未** `@Deprecated`,登录/改密等路径易导致调用方 **NPE 或静默失败**。 |
|
||
| **高** | `getDefaultPwd()` 返回 **null** 与「默认密码」语义矛盾。 |
|
||
| **中** | `ResourceClient` 在**字段初始化**中 `SpringContext.getBean`,容器时序与单测风险。 |
|
||
| **中** | `*Delt*`、`Resrouce`、`BacK` 等命名拼写与可读性问题。 |
|
||
| **低** | `apidoc` 下大量**空 Controller 壳**;需文档说明为 OpenAPI 占位。 |
|
||
| **正向** | 未发现 `System.out` / `printStackTrace`;空 `catch` 启发式未命中。 |
|
||
|
||
## 建议
|
||
|
||
1. 对「桩实现」统一 **`@Deprecated` + 明确失败结果`**,禁止静默 `null`。
|
||
2. 收敛 **`ResourceClient` 初始化时机**(`@PostConstruct` / 懒工厂)。
|
||
3. 全模块 **格式化** + 建立 **错误码/校验 message** 常量表。
|