Add developer profile api

This commit is contained in:
2024-02-23 11:01:03 +08:00
parent d38f9f4a58
commit 3c82107394
11 changed files with 149 additions and 7 deletions

View File

@@ -10,6 +10,7 @@ import top.fatweb.oxygen.api.entity.common.ResponseResult
import top.fatweb.oxygen.api.param.permission.user.*
import top.fatweb.oxygen.api.service.permission.IUserService
import top.fatweb.oxygen.api.vo.PageVo
import top.fatweb.oxygen.api.vo.permission.UserWithInfoVo
import top.fatweb.oxygen.api.vo.permission.UserWithPasswordRoleInfoVo
import top.fatweb.oxygen.api.vo.permission.UserWithPowerInfoVo
import top.fatweb.oxygen.api.vo.permission.UserWithRoleInfoVo
@@ -35,15 +36,34 @@ class UserController(
* @see UserWithPowerInfoVo
*/
@Operation(summary = "获取当前用户信息")
@GetMapping("info")
@GetMapping("/info")
fun getInfo(): ResponseResult<UserWithPowerInfoVo> =
ResponseResult.databaseSuccess(data = userService.getInfo())
/**
* Get basic user information
*
* @param username Username
* @return Response object includes user basic information
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
* @see ResponseResult
* @see UserWithPowerInfoVo
*/
@Operation(summary = "获取指定用户基本信息")
@GetMapping("/info/{username}")
fun getBasicInfo(@PathVariable username: String): ResponseResult<UserWithInfoVo> =
ResponseResult.databaseSuccess(data = userService.getBasicInfo(username))
/**
* Update current user information
*
* @param userInfoUpdateParam Update user information parameters
* @return Response object
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
* @see UserInfoUpdateParam
* @see ResponseResult
*/
@Operation(summary = "更新当前用户信息")
@PatchMapping("info")
@@ -54,8 +74,12 @@ class UserController(
/**
* Change password
*
* @param userChangePasswordParam User change password parameters
* @return Response object
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
* @see UserChangePasswordParam
* @see ResponseResult
*/
@Operation(summary = "更改密码")
@PostMapping("info")

View File

@@ -2,8 +2,10 @@ package top.fatweb.oxygen.api.controller.tool
import jakarta.validation.Valid
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import top.fatweb.oxygen.api.annotation.BaseController
import top.fatweb.oxygen.api.entity.common.ResponseResult
import top.fatweb.oxygen.api.param.PageSortParam
import top.fatweb.oxygen.api.param.tool.ToolStoreGetParam
import top.fatweb.oxygen.api.service.tool.IStoreService
import top.fatweb.oxygen.api.vo.PageVo
@@ -14,18 +16,42 @@ import top.fatweb.oxygen.api.vo.tool.ToolVo
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
* @see IStoreService
*/
@BaseController(path = ["/tool/store"], name = "工具商店", description = "工具商店相关接口")
class StoreController(
private val storeService: IStoreService
) {
/**
* Get store tool in page
* Get store tool paging information
*
* @param toolStoreGetParam Get tool parameters in tool store
* @return Response object includes store tool paging information
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
* @see ToolStoreGetParam
* @see ResponseResult
* @see PageVo
* @see ToolVo
*/
@GetMapping
fun get(@Valid toolStoreGetParam: ToolStoreGetParam): ResponseResult<PageVo<ToolVo>> =
ResponseResult.databaseSuccess(data = storeService.getPage(toolStoreGetParam))
/**
* Get store tool paging information by username
*
* @param username Username
* @param pageSortParam Page sort parameters
* @return Response object includes store tool paging information
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
* @see PageSortParam
* @see ResponseResult
* @see PageVo
* @see ToolVo
*/
@GetMapping("/{username}")
fun get(@PathVariable username: String, @Valid pageSortParam: PageSortParam): ResponseResult<PageVo<ToolVo>> =
ResponseResult.databaseSuccess(data = storeService.getPage(pageSortParam, username))
}