Add GetUserInfo
This commit is contained in:
@@ -3,7 +3,10 @@ package top.fatweb.api.controller.permission
|
||||
import org.springframework.web.bind.annotation.GetMapping
|
||||
import org.springframework.web.bind.annotation.RequestMapping
|
||||
import org.springframework.web.bind.annotation.RestController
|
||||
import top.fatweb.api.converter.UserConverter
|
||||
import top.fatweb.api.entity.common.ResponseResult
|
||||
import top.fatweb.api.service.permission.IUserService
|
||||
import top.fatweb.api.vo.authentication.UserInfoVo
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -19,7 +22,10 @@ class UserController(
|
||||
private val userService: IUserService
|
||||
) {
|
||||
@GetMapping("info")
|
||||
fun getInfo() {
|
||||
fun getInfo(): ResponseResult<UserInfoVo> {
|
||||
userService.getInfo()?.let {
|
||||
return ResponseResult.databaseSuccess(data = UserConverter.userToUserInfoVo(it))
|
||||
} ?: let { return ResponseResult.databaseFail() }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user