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:
@@ -7,6 +7,9 @@ import com.emotion.dto.request.LifePathPageRequest;
|
||||
import com.emotion.dto.request.LifePathUpdateRequest;
|
||||
import com.emotion.dto.response.LifePathResponse;
|
||||
import com.emotion.service.LifePathService;
|
||||
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;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -22,6 +25,7 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/lifePath")
|
||||
@Tag(name = "实现路径管理", description = "人生剧本实现路径的查询、创建、更新和删除接口")
|
||||
public class LifePathController {
|
||||
|
||||
@Autowired
|
||||
@@ -30,6 +34,7 @@ public class LifePathController {
|
||||
/**
|
||||
* 分页查询当前用户的实现路径
|
||||
*/
|
||||
@Operation(summary = "分页查询实现路径", description = "分页查询当前用户的实现路径列表。")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<PageResult<LifePathResponse>> getPage(@Validated LifePathPageRequest request) {
|
||||
PageResult<LifePathResponse> pageResult = lifePathService.getPageByCurrentUser(request);
|
||||
@@ -39,6 +44,7 @@ public class LifePathController {
|
||||
/**
|
||||
* 获取当前用户的所有实现路径列表
|
||||
*/
|
||||
@Operation(summary = "获取实现路径列表", description = "获取当前用户的所有实现路径列表。")
|
||||
@GetMapping(value = "/listAll")
|
||||
public Result<List<LifePathResponse>> getList() {
|
||||
List<LifePathResponse> paths = lifePathService.getListByCurrentUser();
|
||||
@@ -48,8 +54,9 @@ public class LifePathController {
|
||||
/**
|
||||
* 根据剧本ID获取实现路径
|
||||
*/
|
||||
@Operation(summary = "根据剧本ID获取路径", description = "根据剧本 ID 获取对应的实现路径。")
|
||||
@GetMapping(value = "/byScript")
|
||||
public Result<LifePathResponse> getByScriptId(@RequestParam String scriptId) {
|
||||
public Result<LifePathResponse> getByScriptId(@Parameter(description = "剧本 ID") @RequestParam String scriptId) {
|
||||
LifePathResponse path = lifePathService.getByScriptId(scriptId);
|
||||
if (path == null) {
|
||||
return Result.notFound("实现路径不存在");
|
||||
@@ -60,8 +67,9 @@ public class LifePathController {
|
||||
/**
|
||||
* 根据ID获取实现路径详情
|
||||
*/
|
||||
@Operation(summary = "获取路径详情", description = "根据 ID 获取实现路径的详细信息。")
|
||||
@GetMapping(value = "/detail")
|
||||
public Result<LifePathResponse> getById(@RequestParam String id) {
|
||||
public Result<LifePathResponse> getById(@Parameter(description = "路径 ID") @RequestParam String id) {
|
||||
LifePathResponse path = lifePathService.getPathById(id);
|
||||
if (path == null) {
|
||||
return Result.notFound("实现路径不存在");
|
||||
@@ -72,6 +80,7 @@ public class LifePathController {
|
||||
/**
|
||||
* 创建实现路径
|
||||
*/
|
||||
@Operation(summary = "创建实现路径", description = "创建一条新的实现路径。")
|
||||
@PostMapping(value = "/create")
|
||||
public Result<LifePathResponse> create(@Valid @RequestBody LifePathCreateRequest request) {
|
||||
LifePathResponse path = lifePathService.createPath(request);
|
||||
@@ -84,6 +93,7 @@ public class LifePathController {
|
||||
/**
|
||||
* 更新实现路径
|
||||
*/
|
||||
@Operation(summary = "更新实现路径", description = "修改已有实现路径的内容。")
|
||||
@PutMapping(value = "/update")
|
||||
public Result<LifePathResponse> update(@Valid @RequestBody LifePathUpdateRequest request) {
|
||||
LifePathResponse path = lifePathService.updatePath(request);
|
||||
@@ -96,8 +106,9 @@ public class LifePathController {
|
||||
/**
|
||||
* 删除实现路径
|
||||
*/
|
||||
@Operation(summary = "删除实现路径", description = "删除指定的实现路径。")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<Void> delete(@RequestParam String id) {
|
||||
public Result<Void> delete(@Parameter(description = "路径 ID") @RequestParam String id) {
|
||||
boolean deleted = lifePathService.deletePath(id);
|
||||
if (!deleted) {
|
||||
return Result.error("删除失败");
|
||||
|
||||
Reference in New Issue
Block a user