feat: 用户相关api接口
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user