feat:查询用户信息
This commit is contained in:
@@ -5,11 +5,13 @@ import com.xiang.xservice.auth.api.dto.req.LoginRequest;
|
||||
import com.xiang.xservice.auth.api.dto.req.RegisterRequest;
|
||||
import com.xiang.xservice.auth.api.dto.resp.LoginResp;
|
||||
import com.xiang.xservice.auth.api.dto.resp.RegisterResp;
|
||||
import com.xiang.xservice.auth.api.dto.resp.UserDTO;
|
||||
import com.xiang.xservice.auth.service.service.XUserService;
|
||||
import com.xiang.xservice.basic.common.resp.Result;
|
||||
import com.xiang.xservice.basic.exception.BusinessException;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.RestController;
|
||||
@@ -55,4 +57,10 @@ public class TokenController implements TokenApi {
|
||||
}
|
||||
return Result.error("操作失败");
|
||||
}
|
||||
|
||||
@GetMapping("/private/auth/getInfo")
|
||||
public Result<UserDTO> getUserInfo() {
|
||||
// todo token的工具类,直接获取token中的userId无需传参
|
||||
return Result.success(userService.getUserDetail(1L));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.xiang.xservice.basic.common.resp.Result;
|
||||
import com.xiang.xservice.basic.exception.BusinessException;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
@@ -2,7 +2,7 @@ server:
|
||||
port: 38011
|
||||
spring:
|
||||
profiles:
|
||||
active: test
|
||||
active: local
|
||||
application:
|
||||
name: xservice-auth-center
|
||||
mvc:
|
||||
|
||||
Reference in New Issue
Block a user