You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
689 B

⚠️ 潜在越权行为
违规场景 风险描述 正确做法
ListCommand 直接调用 ArticleRepository.findAll() Command 跳过 Controller 直接访问数据层 Command → Controller → Repository
CrawlerController 直接返回 List<Article> 原始引用 外部可修改文章列表,破坏封装 返回 Collections.unmodifiableList() 或副本
HistoryCommand 暴露内部 List<String> 调用方可清空/修改历史记录 getHistory() 返回 new ArrayList<>(history)
✅ 正确的调用链
text
用户输入 → Command (调用) → Controller → Repository → 返回数据
(返回给 Command 展示)