Add api doc to UserController
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
package top.fatweb.api.controller.permission
|
package top.fatweb.api.controller.permission
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.Operation
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag
|
||||||
import org.springframework.web.bind.annotation.GetMapping
|
import org.springframework.web.bind.annotation.GetMapping
|
||||||
import org.springframework.web.bind.annotation.RequestMapping
|
import org.springframework.web.bind.annotation.RequestMapping
|
||||||
import org.springframework.web.bind.annotation.RestController
|
import org.springframework.web.bind.annotation.RestController
|
||||||
@@ -17,11 +19,13 @@ import top.fatweb.api.vo.permission.UserWithRoleInfoVo
|
|||||||
* @author FatttSnake
|
* @author FatttSnake
|
||||||
* @since 2023-10-04
|
* @since 2023-10-04
|
||||||
*/
|
*/
|
||||||
|
@Tag(name = "用户管理", description = "用户管理相关接口")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/system/user")
|
@RequestMapping("/system/user")
|
||||||
class UserController(
|
class UserController(
|
||||||
private val userService: IUserService
|
private val userService: IUserService
|
||||||
) {
|
) {
|
||||||
|
@Operation(summary = "获取当前用户信息")
|
||||||
@GetMapping("info")
|
@GetMapping("info")
|
||||||
fun getInfo(): ResponseResult<UserWithPowerInfoVo> {
|
fun getInfo(): ResponseResult<UserWithPowerInfoVo> {
|
||||||
userService.getInfo()?.let {
|
userService.getInfo()?.let {
|
||||||
@@ -29,6 +33,7 @@ class UserController(
|
|||||||
} ?: let { return ResponseResult.databaseFail() }
|
} ?: let { return ResponseResult.databaseFail() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "获取用户列表")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
fun get(): ResponseResult<List<UserWithRoleInfoVo>> {
|
fun get(): ResponseResult<List<UserWithRoleInfoVo>> {
|
||||||
return ResponseResult.databaseSuccess(
|
return ResponseResult.databaseSuccess(
|
||||||
|
|||||||
Reference in New Issue
Block a user