feat: 全量 Controller 接口中文注解补全完成

- 39 个 Controller 全部添加 @Tag/@Operation/@Parameter 中文注解(共 278 个 @Operation)
- 分 3 批实施:Batch 1 AI+社区(7)、Batch 2 情绪+日记+互动(11)、Batch 3 其他(13)
- 已有注解的 8 个 Controller 不重复修改
- 编译验证通过:mvn clean install -DskipTests — BUILD SUCCESS

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-23 23:27:39 +08:00
parent 88bec9b5df
commit d1a0018d1b
34 changed files with 2014 additions and 135 deletions
@@ -6,6 +6,7 @@ import com.emotion.dto.request.achievement.*;
import com.emotion.dto.response.achievement.AchievementResponse;
import com.emotion.service.AchievementService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
@@ -16,7 +17,7 @@ import java.util.List;
/**
* 成就控制器
*
*
* @author huazhongmin
* @date 2025-09-08
*/
@@ -43,7 +44,7 @@ public class AchievementController {
*/
@Operation(summary = "根据ID获取成就", description = "根据ID获取成就详情")
@GetMapping("/detail")
public Result<AchievementResponse> getById(@RequestParam String id) {
public Result<AchievementResponse> getById(@Parameter(description = "成就 ID") @RequestParam String id) {
AchievementResponse response = achievementService.getAchievementResponseById(id);
if (response == null) {
return Result.notFound("成就不存在");
@@ -82,7 +83,7 @@ public class AchievementController {
*/
@Operation(summary = "删除成就", description = "删除指定成就")
@DeleteMapping("/delete")
public Result<Void> delete(@RequestParam String id) {
public Result<Void> delete(@Parameter(description = "成就 ID") @RequestParam String id) {
boolean deleted = achievementService.removeById(id);
if (!deleted) {
return Result.error("删除失败");
@@ -95,7 +96,7 @@ public class AchievementController {
*/
@Operation(summary = "根据分类查询成就", description = "根据分类查询成就列表")
@GetMapping("/byCategory")
public Result<List<AchievementResponse>> getByCategory(@RequestParam String category) {
public Result<List<AchievementResponse>> getByCategory(@Parameter(description = "分类") @RequestParam String category) {
List<AchievementResponse> responses = achievementService.getByCategoryWithResponse(category);
return Result.success(responses);
}
@@ -105,7 +106,7 @@ public class AchievementController {
*/
@Operation(summary = "根据稀有度查询成就", description = "根据稀有度查询成就列表")
@GetMapping("/byRarity")
public Result<List<AchievementResponse>> getByRarity(@RequestParam String rarity) {
public Result<List<AchievementResponse>> getByRarity(@Parameter(description = "稀有度") @RequestParam String rarity) {
List<AchievementResponse> responses = achievementService.getByRarityWithResponse(rarity);
return Result.success(responses);
}
@@ -181,8 +182,8 @@ public class AchievementController {
*/
@Operation(summary = "查询最近解锁的成就", description = "查询最近解锁的成就列表")
@GetMapping("/recent")
public Result<List<AchievementResponse>> getRecentlyUnlocked(@RequestParam(defaultValue = "10") Integer limit) {
public Result<List<AchievementResponse>> getRecentlyUnlocked(@Parameter(description = "排名数量限制") @RequestParam(defaultValue = "10") Integer limit) {
List<AchievementResponse> responses = achievementService.getRecentlyUnlockedWithResponse(limit);
return Result.success(responses);
}
}
}