diff --git a/src/main/kotlin/top/fatweb/api/controller/UserController.kt b/src/main/kotlin/top/fatweb/api/controller/UserController.kt deleted file mode 100644 index 188caf5..0000000 --- a/src/main/kotlin/top/fatweb/api/controller/UserController.kt +++ /dev/null @@ -1,17 +0,0 @@ -package top.fatweb.api.controller - -import org.springframework.web.bind.annotation.RequestMapping -import org.springframework.web.bind.annotation.RestController - -/** - *

- * 用户 前端控制器 - *

- * - * @author FatttSnake - * @since 2023-10-04 - */ -@RestController -@RequestMapping("/api/user") -class UserController - diff --git a/src/main/kotlin/top/fatweb/api/controller/permission/UserController.kt b/src/main/kotlin/top/fatweb/api/controller/permission/UserController.kt new file mode 100644 index 0000000..3b5a191 --- /dev/null +++ b/src/main/kotlin/top/fatweb/api/controller/permission/UserController.kt @@ -0,0 +1,25 @@ +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.service.permission.IUserService + +/** + *

+ * 用户 前端控制器 + *

+ * + * @author FatttSnake + * @since 2023-10-04 + */ +@RestController +@RequestMapping("/system/user") +class UserController( + private val userService: IUserService +) { + @GetMapping("info") + fun getInfo() { + } +} + diff --git a/src/main/kotlin/top/fatweb/api/entity/common/ResponseResult.kt b/src/main/kotlin/top/fatweb/api/entity/common/ResponseResult.kt index bbfde54..022c4b9 100644 --- a/src/main/kotlin/top/fatweb/api/entity/common/ResponseResult.kt +++ b/src/main/kotlin/top/fatweb/api/entity/common/ResponseResult.kt @@ -21,5 +21,13 @@ class ResponseResult private constructor( fun fail(code: ResponseCode = ResponseCode.SYSTEM_ERROR, msg: String = "fail", data: T? = null) = build(code, false, msg, data) + + fun databaseSuccess( + code: ResponseCode = ResponseCode.DATABASE_SELECT_SUCCESS, msg: String = "success", data: T? = null + ) = build(code, true, msg, data) + + fun databaseFail( + code: ResponseCode = ResponseCode.DATABASE_SELECT_FAILED, msg: String = "fail", data: T? = null + ) = build(code, false, msg, data) } } \ No newline at end of file diff --git a/src/main/kotlin/top/fatweb/api/service/permission/IUserService.kt b/src/main/kotlin/top/fatweb/api/service/permission/IUserService.kt index f5d988d..1634122 100644 --- a/src/main/kotlin/top/fatweb/api/service/permission/IUserService.kt +++ b/src/main/kotlin/top/fatweb/api/service/permission/IUserService.kt @@ -13,4 +13,6 @@ import top.fatweb.api.entity.permission.User */ interface IUserService : IService { fun getUserWithPower(username: String): User? + + fun getInfo(): User }