feat: 用户相关api接口

This commit is contained in:
2026-06-15 18:23:41 +08:00
parent 567bee3e8f
commit 8477e49fa0
13 changed files with 233 additions and 56 deletions

View File

@@ -0,0 +1,31 @@
package com.webgame.webgamebackend.controller;
import com.webgame.webgamebackend.common.dto.ApiResponse;
import com.webgame.webgamebackend.common.dto.user.UserInfoResponse;
import com.webgame.webgamebackend.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 用户控制器
*/
@Validated
@RestController
@RequestMapping("/user")
@RequiredArgsConstructor
public class UserController {
private final UserService userService;
/**
* 获取当前登录用户信息
*/
@GetMapping("/info")
public ApiResponse<UserInfoResponse> info() {
UserInfoResponse result = userService.getCurrentUserInfo();
return ApiResponse.ok(result);
}
}