Add GetUserInfo

This commit is contained in:
2023-10-27 18:20:15 +08:00
parent 7aa2212976
commit 11ceb410c8
13 changed files with 181 additions and 7 deletions

View File

@@ -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() }
}
}