package com.xinquan.user.controller.client; import com.xinquan.common.core.domain.R; import com.xinquan.user.domain.dto.UserAnswerDTO; import com.xinquan.user.domain.vo.AppUserVO; import com.xinquan.user.domain.vo.TagVO; import com.xinquan.user.service.AppUserService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import java.util.List; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** *

* 用户信息表 前端控制器 *

* * @author mitao * @since 2024-08-21 */ @Api(tags = {"用户相关接口"}) @Slf4j @RestController @RequestMapping("/client/app-user") @RequiredArgsConstructor public class ClientAppUserController { private final AppUserService appUserService; /** * 获取当前登录用户信息 * * @return 用户信息 * @see com.xinquan.user.domain.vo.AppUserVO */ @PostMapping("/getCurrentUser") @ApiOperation(value = "获取当前用户信息", tags = {"用户端-用户信息相关接口"}) public R getCurrentUser() { return R.ok(appUserService.getCurrentUser()); } /** * 获取问题二的标签列表 * * @return List */ @GetMapping("/getTagList") @ApiOperation(value = "问题二获取用户标签列表", tags = {"用户端-计划引导相关接口"}) public R> getTagList() { List voList = appUserService.getTagList(); return R.ok(voList); } /** * 保存计划引导页用户的答案 * * @param dto 用户计划引导答案数据传输对象 * @return */ @PostMapping("/saveUserAnswers") @ApiOperation(value = "保存计划引导页用户的答案", tags = {"用户端-计划引导相关接口"}) public R saveUserAnswers(@Validated @RequestBody UserAnswerDTO dto) { appUserService.saveUserAnswers(dto); return R.ok(); } }