refactor(character): 移除冗余Bean拷贝并统一返回VO类型

This commit is contained in:
2025-12-04 16:53:23 +08:00
parent dd7cd517f6
commit 155ed398a2
5 changed files with 37 additions and 10 deletions

View File

@@ -42,8 +42,7 @@ public class CharacterController {
@GetMapping("/list")
@Operation(summary = "人设列表", description = "人设列表接口按 rank 排名")
public BaseResponse<List<KeyboardCharacterRespVO>> list() {
List<KeyboardCharacter> list = characterService.selectListWithRank();
return ResultUtils.success(BeanUtil.copyToList(list, KeyboardCharacterRespVO.class));
return ResultUtils.success(characterService.selectListWithRank());
}
@GetMapping("/detail")
@@ -56,8 +55,7 @@ public class CharacterController {
@GetMapping("/listByTag")
@Operation(summary = "按标签查询人设列表", description = "按标签查询人设列表接口")
public BaseResponse<List<KeyboardCharacterRespVO>> listByTag(@RequestParam("tagId") Long tagId) {
List<KeyboardCharacter> list = characterService.selectListByTag(tagId);
return ResultUtils.success(BeanUtil.copyToList(list, KeyboardCharacterRespVO.class));
return ResultUtils.success(characterService.selectListByTag(tagId));
}
@GetMapping("/listByUser")