feat(themes): 为主题列表接口增加用户购买状态标记

在 KeyboardThemesRespVO 中新增 isPurchased 字段;
selectThemesByStyle 方法增加 userId 参数并查询用户已购主题 ID,
返回结果标记当前用户是否已购买。
This commit is contained in:
2025-12-10 20:36:01 +08:00
parent 03dc005b38
commit 77e8e9a2a7
4 changed files with 42 additions and 13 deletions

View File

@@ -42,8 +42,8 @@ public class ThemesController {
@GetMapping("/listByStyle")
@Operation(summary = "按风格查询主题", description = "按主题风格查询主题列表接口")
public BaseResponse<List<KeyboardThemesRespVO>> listByStyle(@RequestParam("themeStyle") Long themeStyleId) {
return ResultUtils.success(themesService.selectThemesByStyle(themeStyleId));
}
Long userId = StpUtil.getLoginIdAsLong();
return ResultUtils.success(themesService.selectThemesByStyle(themeStyleId,userId));}
@GetMapping("/listAllStyles")
@Operation(summary = "查询所有主题风格", description = "查询所有主题风格列表接口")