Files
starRiverProperty/docs/reviews/alibaba-audit-2026-04-24/06-maven-cw-elevator-application.md
2026-04-24 23:49:37 +08:00

23 lines
1.7 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.
# 06 `maven-cw-elevator-application` — 阿里巴巴规范走查(整理版)
**范围**`maven-cw-elevator-application/**/*.java`(排除 `target/`);优先 `*Service*``*Impl*``*Controller*`**>150 行** 大文件。
## 问题清单(节选)
| 严重度 | 位置 | 类别 | 说明 | 建议 |
|--------|------|------|------|------|
| 阻断 | `PersonRuleServiceImpl.java` | 契约 | `edit` / `timeDetail` / `pageByApp` 等直接 **`return null`** | 返回明确 `CloudwalkResult` 失败体或 `UnsupportedOperationException` |
| 严重 | `AcsElevatorDeviceGetWayController.java` | 安全 | `getKey` 将配置密钥字段下发 HTTP | 鉴权、短期令牌、禁止明文密钥接口化 |
| 严重 | `AcsElevatorDeviceGetWayController.java` | 性能 | `queryZoneTreeCode` 多层循环内重复远程/DB 调用 | 批量查询或缓存 |
| 主要 | 多处 `*ServiceImpl` / `*Controller` | 异常 | 大量 `catch (Exception)` | 收窄并保留 cause |
| 主要 | `AcsElevatorDeviceServiceImpl.java` | 分层 | `@Repository` 误用于 Service;注入实现类而非接口 | `@Service` + 面向接口 |
| 主要 | 各 Controller | 校验 | `@RequestBody``@Valid` | 补 Bean Validation |
| 主要 | `AbstractCloudwalkController.java` | NPE | `RequestContextHolder.getRequestAttributes()` 可能 null | 判空 |
| 次要 | 多处 | 命名 | `getByDeciveCode`**Device** 拼写错误 | 统一修正(评估 API 兼容) |
| 次要 | `FileController.java` | API | `DatatypeConverter.parseBase64Binary` | `Base64.getDecoder()` |
| 次要 | 全模块 | 依赖 | Fastjson 使用 | 版本治理或迁移 Jackson |
## 小结
优先处理 **对外返回 null**、**密钥类接口** 与 **N+1 调用**;其次统一 **异常与分层注解**