Open
Conversation
### 1. JPA getOne() 替换为 findOne() (高优先级) 问题 : getOne() 在实体不存在时会抛出 EntityNotFoundException 运行时异常,而不是返回null,这会导致接口在查询不存在的数据时报500错误。 修复文件 : - ArticleServiceImpl.java:55,89,125 - 3处 - CategoryServiceImpl.java:33,46 - 2处 - TagServiceImpl.java:33,46 - 2处 - CommentServiceImpl.java:45 - 1处 ### 2. Controller层错误码错误 (中优先级) 问题 : 复制粘贴导致的错误码使用错误,在ID为空时错误地返回了 USER_NOT_EXIST (用户不存在) 而不是 PARAM_IS_BLANK (参数为空)。 修复文件 : - CategoryController.java:110 - TagController.java:119 - ArticleController.java:176 ### 3. TagController命名错误 (低优先级) 问题 : 复制粘贴导致的方法名和变量名错误, listCategorysDetail 应该是 listTagsDetail 。 修复文件 : - TagController.java:49-52 ### 4. UploadController缺少@RequestParam (中优先级) 问题 : Spring MVC文件上传需要 @RequestParam 注解才能正确绑定MultipartFile参数。 修复文件 : - UploadController.java:35 - 添加 @RequestParam("image") 注解 ### 5. OAuthSessionManager空指针问题 (中优先级) 问题 : 当请求头中没有 Oauth-Token 时,直接返回null会导致后续空指针异常。 修复 : 添加了空值判断和降级处理。 ### 修复原则 - 不影响现有功能 : 所有修复都是基于原有逻辑的bug修复,没有改变业务流程 - 最小化改动 : 只修复明确的bug,不进行重构 - 向后兼容 : 修复后的接口行为与预期一致,不会破坏前端调用 利用模型 【DOUBAO-DOGFOOD】 纠正接口,并且简单验证没有影响原始代码
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1. JPA getOne() 替换为 findOne() (高优先级)
问题 : getOne() 在实体不存在时会抛出 EntityNotFoundException 运行时异常,而不是返回null,这会导致接口在查询不存在的数据时报500错误。
修复文件 :
问题 : 复制粘贴导致的错误码使用错误,在ID为空时错误地返回了 USER_NOT_EXIST (用户不存在) 而不是 PARAM_IS_BLANK (参数为空)。
修复文件 :
问题 : 复制粘贴导致的方法名和变量名错误, listCategorysDetail 应该是 listTagsDetail 。
修复文件 :
问题 : Spring MVC文件上传需要 @RequestParam 注解才能正确绑定MultipartFile参数。
修复文件 :
问题 : 当请求头中没有 Oauth-Token 时,直接返回null会导致后续空指针异常。
修复 : 添加了空值判断和降级处理。
修复原则
利用模型 【DOUBAO-DOGFOOD】 纠正接口,并且简单验证没有影响原始代码