Files
starRiverProperty/docs/reviews/alibaba-audit-2026-04-24/07-maven-cwos-resource.md
2026-04-24 23:49:37 +08:00

21 lines
1.1 KiB
Markdown
Raw Permalink 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.
# 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** 常量表。