Add kdoc
This commit is contained in:
@@ -17,6 +17,13 @@ import java.util.*
|
|||||||
@EnableTransactionManagement
|
@EnableTransactionManagement
|
||||||
class FatWebApiApplication
|
class FatWebApiApplication
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main function
|
||||||
|
*
|
||||||
|
* @param args
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
val logger = LoggerFactory.getLogger("main")
|
val logger = LoggerFactory.getLogger("main")
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,9 @@ import top.fatweb.avatargenerator.GitHubAvatar
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see IUserService
|
||||||
|
* @see IUserInfoService
|
||||||
|
* @see PasswordEncoder
|
||||||
*/
|
*/
|
||||||
@DependsOn("adminProperties")
|
@DependsOn("adminProperties")
|
||||||
@Component
|
@Component
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ import top.fatweb.api.handler.JwtAuthenticationEntryPointHandler
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see JwtAuthenticationTokenFilter
|
||||||
|
* @see JwtAuthenticationEntryPointHandler
|
||||||
|
* @see JwtAccessDeniedHandler
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableMethodSecurity
|
@EnableMethodSecurity
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import top.fatweb.api.interceptor.SysLogInterceptor
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see SysLogInterceptor
|
||||||
* @see WebMvcConfigurer
|
* @see WebMvcConfigurer
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import top.fatweb.api.vo.api.v1.avatar.AvatarBase64Vo
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see IAvatarService
|
||||||
*/
|
*/
|
||||||
@Tag(name = "随机头像", description = "随机头像相关接口")
|
@Tag(name = "随机头像", description = "随机头像相关接口")
|
||||||
@RequestMapping("/api/{apiVersion}/avatar")
|
@RequestMapping("/api/{apiVersion}/avatar")
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import top.fatweb.api.vo.permission.TokenVo
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see IAuthenticationService
|
||||||
*/
|
*/
|
||||||
@Tag(name = "身份认证", description = "身份认证相关接口")
|
@Tag(name = "身份认证", description = "身份认证相关接口")
|
||||||
@RestController
|
@RestController
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import top.fatweb.api.vo.permission.base.GroupVo
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see IGroupService
|
||||||
*/
|
*/
|
||||||
@Tag(name = "用户组管理", description = "用户组管理相关接口")
|
@Tag(name = "用户组管理", description = "用户组管理相关接口")
|
||||||
@RequestMapping("/system/group")
|
@RequestMapping("/system/group")
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import top.fatweb.api.vo.permission.PowerSetVo
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see IPowerService
|
||||||
*/
|
*/
|
||||||
@Tag(name = "权限管理", description = "权限管理相关接口")
|
@Tag(name = "权限管理", description = "权限管理相关接口")
|
||||||
@RequestMapping("/system/power")
|
@RequestMapping("/system/power")
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import top.fatweb.api.vo.permission.base.RoleVo
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see IRoleService
|
||||||
*/
|
*/
|
||||||
@Tag(name = "角色管理", description = "角色管理相关接口")
|
@Tag(name = "角色管理", description = "角色管理相关接口")
|
||||||
@RequestMapping("/system/role")
|
@RequestMapping("/system/role")
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import top.fatweb.api.vo.permission.UserWithRoleInfoVo
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see IUserService
|
||||||
*/
|
*/
|
||||||
@Tag(name = "用户管理", description = "用户管理相关接口")
|
@Tag(name = "用户管理", description = "用户管理相关接口")
|
||||||
@RequestMapping("/system/user")
|
@RequestMapping("/system/user")
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package top.fatweb.api.controller.system
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping
|
||||||
|
import org.springframework.web.bind.annotation.RestController
|
||||||
|
|
||||||
|
@Tag(name = "邮件接口", description = "邮件发送接口")
|
||||||
|
@RequestMapping("/system/mail")
|
||||||
|
@RestController
|
||||||
|
class MailController {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -13,6 +13,7 @@ import top.fatweb.api.vo.system.SettingsVo
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see ISettingsService
|
||||||
*/
|
*/
|
||||||
@Tag(name = "系统设置", description = "系统设置相关接口")
|
@Tag(name = "系统设置", description = "系统设置相关接口")
|
||||||
@RequestMapping("/system/settings")
|
@RequestMapping("/system/settings")
|
||||||
@@ -20,10 +21,29 @@ import top.fatweb.api.vo.system.SettingsVo
|
|||||||
class SettingsController(
|
class SettingsController(
|
||||||
private val settingsService: ISettingsService
|
private val settingsService: ISettingsService
|
||||||
) {
|
) {
|
||||||
|
/**
|
||||||
|
* Get all settings
|
||||||
|
*
|
||||||
|
* @return Response object includes all settings
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see ResponseResult
|
||||||
|
* @see SettingsVo
|
||||||
|
*/
|
||||||
@Operation(summary = "获取全部设置")
|
@Operation(summary = "获取全部设置")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
fun get(): ResponseResult<SettingsVo> = ResponseResult.success(data = settingsService.get())
|
fun get(): ResponseResult<SettingsVo> = ResponseResult.success(data = settingsService.get())
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update mail settings
|
||||||
|
*
|
||||||
|
* @param mailSettingsParam Mail settings parameters
|
||||||
|
* @return Response object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see MailSettingsParam
|
||||||
|
* @see ResponseResult
|
||||||
|
*/
|
||||||
@Operation(summary = "更新邮件设置")
|
@Operation(summary = "更新邮件设置")
|
||||||
@PutMapping("/mail")
|
@PutMapping("/mail")
|
||||||
fun updateMail(@RequestBody mailSettingsParam: MailSettingsParam): ResponseResult<Nothing> {
|
fun updateMail(@RequestBody mailSettingsParam: MailSettingsParam): ResponseResult<Nothing> {
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import top.fatweb.api.vo.system.SysLogVo
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see ISysLogService
|
||||||
*/
|
*/
|
||||||
@Tag(name = "系统日志", description = "系统日志相关接口")
|
@Tag(name = "系统日志", description = "系统日志相关接口")
|
||||||
@RequestMapping("/system/log")
|
@RequestMapping("/system/log")
|
||||||
|
|||||||
@@ -4,7 +4,23 @@ import top.fatweb.api.settings.MailSettings
|
|||||||
import top.fatweb.api.settings.SystemSettings
|
import top.fatweb.api.settings.SystemSettings
|
||||||
import top.fatweb.api.vo.system.SettingsVo
|
import top.fatweb.api.vo.system.SettingsVo
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Settings converter
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
object SettingsConverter {
|
object SettingsConverter {
|
||||||
|
/**
|
||||||
|
* Convert MailSettings object into MailSettingsVo object
|
||||||
|
*
|
||||||
|
* @param mailSettings MailSettings object
|
||||||
|
* @return MailSettingsVo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see MailSettings
|
||||||
|
* @see SettingsVo.MailSettingsVo
|
||||||
|
*/
|
||||||
private fun mailSettingsToMailSettingsVo(mailSettings: MailSettings) = SettingsVo.MailSettingsVo(
|
private fun mailSettingsToMailSettingsVo(mailSettings: MailSettings) = SettingsVo.MailSettingsVo(
|
||||||
host = mailSettings.host,
|
host = mailSettings.host,
|
||||||
port = mailSettings.port,
|
port = mailSettings.port,
|
||||||
@@ -13,6 +29,16 @@ object SettingsConverter {
|
|||||||
from = mailSettings.from
|
from = mailSettings.from
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert SystemSettings object into SettingVo object
|
||||||
|
*
|
||||||
|
* @param systemSettings SystemSettings object
|
||||||
|
* @return SettingsVo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see SystemSettings
|
||||||
|
* @see SettingsVo
|
||||||
|
*/
|
||||||
fun systemSettingsToSettingsVo(systemSettings: SystemSettings) = SettingsVo(
|
fun systemSettingsToSettingsVo(systemSettings: SystemSettings) = SettingsVo(
|
||||||
mail = systemSettings.mail?.let { mailSettingsToMailSettingsVo(it) }
|
mail = systemSettings.mail?.let { mailSettingsToMailSettingsVo(it) }
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -7,8 +7,35 @@ package top.fatweb.api.entity.common
|
|||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
enum class BusinessCode(val code: Int) {
|
enum class BusinessCode(val code: Int) {
|
||||||
|
/**
|
||||||
|
* System
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
SYSTEM(100),
|
SYSTEM(100),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permission
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
PERMISSION(200),
|
PERMISSION(200),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Database
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
DATABASE(300),
|
DATABASE(300),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Avatar API
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
API_AVATAR(501)
|
API_AVATAR(501)
|
||||||
}
|
}
|
||||||
@@ -19,22 +19,83 @@ class ResponseResult<T> private constructor(
|
|||||||
@Schema(description = "数据") val data: T?
|
@Schema(description = "数据") val data: T?
|
||||||
) : Serializable {
|
) : Serializable {
|
||||||
companion object {
|
companion object {
|
||||||
|
/**
|
||||||
|
* Build response result object
|
||||||
|
*
|
||||||
|
* @param code Response code
|
||||||
|
* @param success Is successful
|
||||||
|
* @param msg Response message
|
||||||
|
* @param data Response data
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
fun <T> build(code: Int, success: Boolean, msg: String, data: T?) =
|
fun <T> build(code: Int, success: Boolean, msg: String, data: T?) =
|
||||||
ResponseResult(code, success, msg, data)
|
ResponseResult(code, success, msg, data)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build response result object
|
||||||
|
*
|
||||||
|
* @param code Response code object
|
||||||
|
* @param success Is successful
|
||||||
|
* @param msg Response message
|
||||||
|
* @param data Response data
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see ResponseCode
|
||||||
|
*/
|
||||||
fun <T> build(code: ResponseCode, success: Boolean, msg: String, data: T?) =
|
fun <T> build(code: ResponseCode, success: Boolean, msg: String, data: T?) =
|
||||||
build(code.code, success, msg, data)
|
build(code.code, success, msg, data)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build successful response result object
|
||||||
|
*
|
||||||
|
* @param code Response code object
|
||||||
|
* @param msg Response message
|
||||||
|
* @param data Response data
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see ResponseCode
|
||||||
|
*/
|
||||||
fun <T> success(code: ResponseCode = ResponseCode.SYSTEM_OK, msg: String = "success", data: T? = null) =
|
fun <T> success(code: ResponseCode = ResponseCode.SYSTEM_OK, msg: String = "success", data: T? = null) =
|
||||||
build(code, true, msg, data)
|
build(code, true, msg, data)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build failure response result object
|
||||||
|
*
|
||||||
|
* @param code Response code object
|
||||||
|
* @param msg Response message
|
||||||
|
* @param data Response data
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see ResponseCode
|
||||||
|
*/
|
||||||
fun <T> fail(code: ResponseCode = ResponseCode.SYSTEM_ERROR, msg: String = "fail", data: T? = null) =
|
fun <T> fail(code: ResponseCode = ResponseCode.SYSTEM_ERROR, msg: String = "fail", data: T? = null) =
|
||||||
build(code, false, msg, data)
|
build(code, false, msg, data)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build database successful response result object
|
||||||
|
*
|
||||||
|
* @param code Response code object
|
||||||
|
* @param msg Response message
|
||||||
|
* @param data Response data
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see ResponseCode
|
||||||
|
*/
|
||||||
fun <T> databaseSuccess(
|
fun <T> databaseSuccess(
|
||||||
code: ResponseCode = ResponseCode.DATABASE_SELECT_SUCCESS, msg: String = "success", data: T? = null
|
code: ResponseCode = ResponseCode.DATABASE_SELECT_SUCCESS, msg: String = "success", data: T? = null
|
||||||
) = build(code, true, msg, data)
|
) = build(code, true, msg, data)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build database failure response result object
|
||||||
|
*
|
||||||
|
* @param code Response code object
|
||||||
|
* @param msg Response message
|
||||||
|
* @param data Response data
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see ResponseCode
|
||||||
|
*/
|
||||||
fun <T> databaseFail(
|
fun <T> databaseFail(
|
||||||
code: ResponseCode = ResponseCode.DATABASE_SELECT_FAILED, msg: String = "fail", data: T? = null
|
code: ResponseCode = ResponseCode.DATABASE_SELECT_FAILED, msg: String = "fail", data: T? = null
|
||||||
) = build(code, false, msg, data)
|
) = build(code, false, msg, data)
|
||||||
|
|||||||
@@ -13,24 +13,38 @@ import java.io.Serializable
|
|||||||
*/
|
*/
|
||||||
@TableName("t_func")
|
@TableName("t_func")
|
||||||
class Func : Serializable {
|
class Func : Serializable {
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableId("id")
|
@TableId("id")
|
||||||
var id: Long? = null
|
var id: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 功能名
|
* Name
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("name")
|
@TableField("name")
|
||||||
var name: String? = null
|
var name: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 父ID
|
* Parent ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("parent_id")
|
@TableField("parent_id")
|
||||||
var parentId: Long? = null
|
var parentId: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单ID
|
* Menu ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("menu_id")
|
@TableField("menu_id")
|
||||||
var menuId: Long? = null
|
var menuId: Long? = null
|
||||||
|
|||||||
@@ -12,42 +12,80 @@ import java.time.LocalDateTime
|
|||||||
*/
|
*/
|
||||||
@TableName("t_group")
|
@TableName("t_group")
|
||||||
class Group : Serializable {
|
class Group : Serializable {
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableId("id")
|
@TableId("id")
|
||||||
var id: Long? = null
|
var id: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户组名
|
* Name
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("name")
|
@TableField("name")
|
||||||
var name: String? = null
|
var name: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启用
|
* Enable
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("enable")
|
@TableField("enable")
|
||||||
var enable: Int? = null
|
var enable: Int? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* Create time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
*/
|
*/
|
||||||
@TableField("create_time", fill = FieldFill.INSERT)
|
@TableField("create_time", fill = FieldFill.INSERT)
|
||||||
var createTime: LocalDateTime? = null
|
var createTime: LocalDateTime? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改时间
|
* Update time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
*/
|
*/
|
||||||
@TableField("update_time", fill = FieldFill.INSERT_UPDATE)
|
@TableField("update_time", fill = FieldFill.INSERT_UPDATE)
|
||||||
var updateTime: LocalDateTime? = null
|
var updateTime: LocalDateTime? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deleted
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableField("deleted")
|
@TableField("deleted")
|
||||||
@TableLogic
|
@TableLogic
|
||||||
var deleted: Long? = null
|
var deleted: Long? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableField("version")
|
@TableField("version")
|
||||||
@Version
|
@Version
|
||||||
var version: Int? = null
|
var version: Int? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Role list
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see Role
|
||||||
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
var roles: List<Role>? = null
|
var roles: List<Role>? = null
|
||||||
|
|
||||||
|
|||||||
@@ -13,9 +13,17 @@ import java.time.ZoneOffset
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see UserDetails
|
||||||
*/
|
*/
|
||||||
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)
|
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)
|
||||||
class LoginUser() : UserDetails {
|
class LoginUser() : UserDetails {
|
||||||
|
/**
|
||||||
|
* User object
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see User
|
||||||
|
*/
|
||||||
lateinit var user: User
|
lateinit var user: User
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
|
|||||||
@@ -13,30 +13,47 @@ import java.io.Serializable
|
|||||||
*/
|
*/
|
||||||
@TableName("t_menu")
|
@TableName("t_menu")
|
||||||
class Menu : Serializable {
|
class Menu : Serializable {
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableId("id")
|
@TableId("id")
|
||||||
var id: Long? = null
|
var id: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单名
|
* Name
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("name")
|
@TableField("name")
|
||||||
var name: String? = null
|
var name: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* URL
|
* URL
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("url")
|
@TableField("url")
|
||||||
var url: String? = null
|
var url: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 父ID
|
* Parent ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("parent_id")
|
@TableField("parent_id")
|
||||||
var parentId: Long? = null
|
var parentId: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 模块ID
|
* Module ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("module_id")
|
@TableField("module_id")
|
||||||
var moduleId: Long? = null
|
var moduleId: Long? = null
|
||||||
|
|||||||
@@ -13,12 +13,20 @@ import java.io.Serializable
|
|||||||
*/
|
*/
|
||||||
@TableName("t_module")
|
@TableName("t_module")
|
||||||
class Module : Serializable {
|
class Module : Serializable {
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableId("id")
|
@TableId("id")
|
||||||
var id: Long? = null
|
var id: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 模块名
|
* Name
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("name")
|
@TableField("name")
|
||||||
var name: String? = null
|
var name: String? = null
|
||||||
|
|||||||
@@ -13,24 +13,38 @@ import java.io.Serializable
|
|||||||
*/
|
*/
|
||||||
@TableName("t_operation")
|
@TableName("t_operation")
|
||||||
class Operation : Serializable {
|
class Operation : Serializable {
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableId("id")
|
@TableId("id")
|
||||||
var id: Long? = null
|
var id: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作名
|
* Name
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("name")
|
@TableField("name")
|
||||||
var name: String? = null
|
var name: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作编码
|
* Code
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("code")
|
@TableField("code")
|
||||||
var code: String? = null
|
var code: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 功能ID
|
* Function ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("func_id")
|
@TableField("func_id")
|
||||||
var funcId: Long? = null
|
var funcId: Long? = null
|
||||||
|
|||||||
@@ -13,12 +13,20 @@ import java.io.Serializable
|
|||||||
*/
|
*/
|
||||||
@TableName("t_power")
|
@TableName("t_power")
|
||||||
class Power : Serializable {
|
class Power : Serializable {
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableId("id")
|
@TableId("id")
|
||||||
var id: Long? = null
|
var id: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 权限类型
|
* Type ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("type_id")
|
@TableField("type_id")
|
||||||
var typeId: Int? = null
|
var typeId: Int? = null
|
||||||
|
|||||||
@@ -11,26 +11,49 @@ import java.io.Serializable
|
|||||||
*/
|
*/
|
||||||
@TableName("t_power_role")
|
@TableName("t_power_role")
|
||||||
class PowerRole : Serializable {
|
class PowerRole : Serializable {
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableId("id")
|
@TableId("id")
|
||||||
var id: Long? = null
|
var id: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 权限
|
* Power ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("power_id")
|
@TableField("power_id")
|
||||||
var powerId: Long? = null
|
var powerId: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色
|
* Role ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("role_id")
|
@TableField("role_id")
|
||||||
var roleId: Long? = null
|
var roleId: Long? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deleted
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableField("deleted")
|
@TableField("deleted")
|
||||||
@TableLogic
|
@TableLogic
|
||||||
var deleted: Long? = null
|
var deleted: Long? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableField("version")
|
@TableField("version")
|
||||||
@Version
|
@Version
|
||||||
var version: Int? = null
|
var version: Int? = null
|
||||||
|
|||||||
@@ -9,11 +9,39 @@ import java.io.Serializable
|
|||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
class PowerSet : Serializable {
|
class PowerSet : Serializable {
|
||||||
|
/**
|
||||||
|
* Module list
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see Module
|
||||||
|
*/
|
||||||
var moduleList: List<Module>? = null
|
var moduleList: List<Module>? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Menu list
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see Menu
|
||||||
|
*/
|
||||||
var menuList: List<Menu>? = null
|
var menuList: List<Menu>? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function list
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see Func
|
||||||
|
*/
|
||||||
var funcList: List<Func>? = null
|
var funcList: List<Func>? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Operation list
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see Operation
|
||||||
|
*/
|
||||||
var operationList: List<Operation>? = null
|
var operationList: List<Operation>? = null
|
||||||
}
|
}
|
||||||
@@ -13,12 +13,20 @@ import java.io.Serializable
|
|||||||
*/
|
*/
|
||||||
@TableName("t_power_type")
|
@TableName("t_power_type")
|
||||||
class PowerType : Serializable {
|
class PowerType : Serializable {
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableId("id")
|
@TableId("id")
|
||||||
var id: Long? = null
|
var id: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 权限类型名
|
* Name
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("name")
|
@TableField("name")
|
||||||
var name: String? = null
|
var name: String? = null
|
||||||
|
|||||||
@@ -12,54 +12,120 @@ import java.time.LocalDateTime
|
|||||||
*/
|
*/
|
||||||
@TableName("t_role")
|
@TableName("t_role")
|
||||||
class Role : Serializable {
|
class Role : Serializable {
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableId("id")
|
@TableId("id")
|
||||||
var id: Long? = null
|
var id: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色名
|
* Name
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("name")
|
@TableField("name")
|
||||||
var name: String? = null
|
var name: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启用
|
* Enable
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("enable")
|
@TableField("enable")
|
||||||
var enable: Int? = null
|
var enable: Int? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* Create time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
*/
|
*/
|
||||||
@TableField("create_time", fill = FieldFill.INSERT)
|
@TableField("create_time", fill = FieldFill.INSERT)
|
||||||
var createTime: LocalDateTime? = null
|
var createTime: LocalDateTime? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改时间
|
* Update time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
*/
|
*/
|
||||||
@TableField("update_time", fill = FieldFill.INSERT_UPDATE)
|
@TableField("update_time", fill = FieldFill.INSERT_UPDATE)
|
||||||
var updateTime: LocalDateTime? = null
|
var updateTime: LocalDateTime? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deleted
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableField("deleted")
|
@TableField("deleted")
|
||||||
@TableLogic
|
@TableLogic
|
||||||
var deleted: Long? = null
|
var deleted: Long? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableField("version")
|
@TableField("version")
|
||||||
@Version
|
@Version
|
||||||
var version: Int? = null
|
var version: Int? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module list
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see Module
|
||||||
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
var modules: List<Module>? = null
|
var modules: List<Module>? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Menu list
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see Menu
|
||||||
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
var menus: List<Menu>? = null
|
var menus: List<Menu>? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function list
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see Func
|
||||||
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
var funcs: List<Func>? = null
|
var funcs: List<Func>? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Operation list
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see Operation
|
||||||
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
var operations: List<Operation>? = null
|
var operations: List<Operation>? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Power list
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see Power
|
||||||
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
var powers: List<Power>? = null
|
var powers: List<Power>? = null
|
||||||
|
|
||||||
|
|||||||
@@ -11,26 +11,49 @@ import java.io.Serializable
|
|||||||
*/
|
*/
|
||||||
@TableName("t_role_group")
|
@TableName("t_role_group")
|
||||||
class RoleGroup : Serializable {
|
class RoleGroup : Serializable {
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableId("id")
|
@TableId("id")
|
||||||
var id: Long? = null
|
var id: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色
|
* Role ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("role_id")
|
@TableField("role_id")
|
||||||
var roleId: Long? = null
|
var roleId: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 群组
|
* Group ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("group_id")
|
@TableField("group_id")
|
||||||
var groupId: Long? = null
|
var groupId: Long? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deleted
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableField("deleted")
|
@TableField("deleted")
|
||||||
@TableLogic
|
@TableLogic
|
||||||
var deleted: Long? = null
|
var deleted: Long? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableField("version")
|
@TableField("version")
|
||||||
@Version
|
@Version
|
||||||
var version: Int? = null
|
var version: Int? = null
|
||||||
|
|||||||
@@ -19,107 +19,216 @@ class User() : Serializable {
|
|||||||
this.enable = if (enable) 1 else 0
|
this.enable = if (enable) 1 else 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableId("id")
|
@TableId("id")
|
||||||
var id: Long? = null
|
var id: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户名
|
* Username
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("username")
|
@TableField("username")
|
||||||
var username: String? = null
|
var username: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 密码
|
* Password
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("password")
|
@TableField("password")
|
||||||
var password: String? = null
|
var password: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 锁定
|
* Locking
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("locking")
|
@TableField("locking")
|
||||||
var locking: Int? = null
|
var locking: Int? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 过期时间
|
* Expiration time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
*/
|
*/
|
||||||
@TableField("expiration")
|
@TableField("expiration")
|
||||||
var expiration: LocalDateTime? = null
|
var expiration: LocalDateTime? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 认证过期时间
|
* Credentials expiration time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
*/
|
*/
|
||||||
@TableField("credentials_expiration")
|
@TableField("credentials_expiration")
|
||||||
var credentialsExpiration: LocalDateTime? = null
|
var credentialsExpiration: LocalDateTime? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启用
|
* Enable
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("enable")
|
@TableField("enable")
|
||||||
var enable: Int? = null
|
var enable: Int? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前登录时间
|
* Current login time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
*/
|
*/
|
||||||
@TableField("current_login_time")
|
@TableField("current_login_time")
|
||||||
var currentLoginTime: LocalDateTime? = null
|
var currentLoginTime: LocalDateTime? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 当前登录 IP
|
* Current login IP
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("current_login_ip")
|
@TableField("current_login_ip")
|
||||||
var currentLoginIp: String? = null
|
var currentLoginIp: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上次登录时间
|
* Last login time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
*/
|
*/
|
||||||
@TableField("last_login_time")
|
@TableField("last_login_time")
|
||||||
var lastLoginTime: LocalDateTime? = null
|
var lastLoginTime: LocalDateTime? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上次登录 IP
|
* Last login IP
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("last_login_ip")
|
@TableField("last_login_ip")
|
||||||
var lastLoginIp: String? = null
|
var lastLoginIp: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* Create time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
*/
|
*/
|
||||||
@TableField("create_time")
|
@TableField("create_time")
|
||||||
var createTime: LocalDateTime? = null
|
var createTime: LocalDateTime? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改时间
|
* Update time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
*/
|
*/
|
||||||
@TableField("update_time")
|
@TableField("update_time")
|
||||||
var updateTime: LocalDateTime? = null
|
var updateTime: LocalDateTime? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deleted
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableField("deleted")
|
@TableField("deleted")
|
||||||
@TableLogic
|
@TableLogic
|
||||||
var deleted: Long? = null
|
var deleted: Long? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableField("version")
|
@TableField("version")
|
||||||
@Version
|
@Version
|
||||||
var version: Int? = null
|
var version: Int? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* User info
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see UserInfo
|
||||||
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
var userInfo: UserInfo? = null
|
var userInfo: UserInfo? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Role list
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see Role
|
||||||
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
var roles: List<Role>? = null
|
var roles: List<Role>? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Group list
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see Group
|
||||||
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
var groups: List<Group>? = null
|
var groups: List<Group>? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module list
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see Module
|
||||||
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
var modules: List<Module>? = null
|
var modules: List<Module>? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Menu list
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see Menu
|
||||||
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
var menus: List<Menu>? = null
|
var menus: List<Menu>? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function list
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see Func
|
||||||
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
var funcs: List<Func>? = null
|
var funcs: List<Func>? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Operation list
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see Operation
|
||||||
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
var operations: List<Operation>? = null
|
var operations: List<Operation>? = null
|
||||||
|
|
||||||
|
|||||||
@@ -11,26 +11,49 @@ import java.io.Serializable
|
|||||||
*/
|
*/
|
||||||
@TableName("t_user_group")
|
@TableName("t_user_group")
|
||||||
class UserGroup : Serializable {
|
class UserGroup : Serializable {
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableId("id")
|
@TableId("id")
|
||||||
var id: Long? = null
|
var id: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户
|
* User ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("user_id")
|
@TableField("user_id")
|
||||||
var userId: Long? = null
|
var userId: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户组
|
* Group ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("group_id")
|
@TableField("group_id")
|
||||||
var groupId: Long? = null
|
var groupId: Long? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deleted
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableField("deleted")
|
@TableField("deleted")
|
||||||
@TableLogic
|
@TableLogic
|
||||||
var deleted: Long? = null
|
var deleted: Long? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableField("version")
|
@TableField("version")
|
||||||
@Version
|
@Version
|
||||||
var version: Int? = null
|
var version: Int? = null
|
||||||
|
|||||||
@@ -12,47 +12,87 @@ import java.time.LocalDateTime
|
|||||||
*/
|
*/
|
||||||
@TableName("t_user_info")
|
@TableName("t_user_info")
|
||||||
class UserInfo : Serializable {
|
class UserInfo : Serializable {
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableId("id")
|
@TableId("id")
|
||||||
var id: Long? = null
|
var id: Long? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* User ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableField("user_id")
|
@TableField("user_id")
|
||||||
var userId: Long? = null
|
var userId: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 昵称
|
* Nickname
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("nickname")
|
@TableField("nickname")
|
||||||
var nickname: String? = null
|
var nickname: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 头像
|
* Avatar in base64
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("avatar")
|
@TableField("avatar")
|
||||||
var avatar: String? = null
|
var avatar: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 邮箱
|
* Email
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("email")
|
@TableField("email")
|
||||||
var email: String? = null
|
var email: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* Create time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
*/
|
*/
|
||||||
@TableField("create_time", fill = FieldFill.INSERT)
|
@TableField("create_time", fill = FieldFill.INSERT)
|
||||||
var createTime: LocalDateTime? = null
|
var createTime: LocalDateTime? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改时间
|
* Update time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
*/
|
*/
|
||||||
@TableField("update_time", fill = FieldFill.INSERT_UPDATE)
|
@TableField("update_time", fill = FieldFill.INSERT_UPDATE)
|
||||||
var updateTime: LocalDateTime? = null
|
var updateTime: LocalDateTime? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deleted
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableField("deleted")
|
@TableField("deleted")
|
||||||
@TableLogic
|
@TableLogic
|
||||||
var deleted: Long? = null
|
var deleted: Long? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableField("version")
|
@TableField("version")
|
||||||
@Version
|
@Version
|
||||||
var version: Int? = null
|
var version: Int? = null
|
||||||
|
|||||||
@@ -11,26 +11,49 @@ import java.io.Serializable
|
|||||||
*/
|
*/
|
||||||
@TableName("t_user_role")
|
@TableName("t_user_role")
|
||||||
class UserRole : Serializable {
|
class UserRole : Serializable {
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableId("id")
|
@TableId("id")
|
||||||
var id: Long? = null
|
var id: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户
|
* User ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("user_id")
|
@TableField("user_id")
|
||||||
var userId: Long? = null
|
var userId: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 角色
|
* Role ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("role_id")
|
@TableField("role_id")
|
||||||
var roleId: Long? = null
|
var roleId: Long? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deleted
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableField("deleted")
|
@TableField("deleted")
|
||||||
@TableLogic
|
@TableLogic
|
||||||
var deleted: Long? = null
|
var deleted: Long? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Version
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableField("version")
|
@TableField("version")
|
||||||
@Version
|
@Version
|
||||||
var version: Int? = null
|
var version: Int? = null
|
||||||
|
|||||||
@@ -14,94 +14,150 @@ import java.time.LocalDateTime
|
|||||||
*/
|
*/
|
||||||
@TableName("t_sys_log")
|
@TableName("t_sys_log")
|
||||||
class SysLog : Serializable {
|
class SysLog : Serializable {
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableId("id")
|
@TableId("id")
|
||||||
var id: Long? = null
|
var id: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 日志类型
|
* Log type
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("log_type")
|
@TableField("log_type")
|
||||||
var logType: String? = null
|
var logType: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作用户
|
* Operate user ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("operate_user_id")
|
@TableField("operate_user_id")
|
||||||
var operateUserId: Long? = null
|
var operateUserId: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作时间
|
* Operate time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
*/
|
*/
|
||||||
@TableField("operate_time")
|
@TableField("operate_time")
|
||||||
var operateTime: LocalDateTime? = null
|
var operateTime: LocalDateTime? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求 URI
|
* Request URI
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("request_uri")
|
@TableField("request_uri")
|
||||||
var requestUri: String? = null
|
var requestUri: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求方式
|
* Request method
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("request_method")
|
@TableField("request_method")
|
||||||
var requestMethod: String? = null
|
var requestMethod: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求参数
|
* Request parameters
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("request_params")
|
@TableField("request_params")
|
||||||
var requestParams: String? = null
|
var requestParams: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求 IP
|
* Request IP
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("request_ip")
|
@TableField("request_ip")
|
||||||
var requestIp: String? = null
|
var requestIp: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求服务器地址
|
* Request server address
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("request_server_address")
|
@TableField("request_server_address")
|
||||||
var requestServerAddress: String? = null
|
var requestServerAddress: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否异常
|
* Is exception
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("exception")
|
@TableField("exception")
|
||||||
var exception: Int? = null
|
var exception: Int? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 异常信息
|
* Exception information
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("exception_info")
|
@TableField("exception_info")
|
||||||
var exceptionInfo: String? = null
|
var exceptionInfo: String? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开始时间
|
* Start time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
*/
|
*/
|
||||||
@TableField("start_time")
|
@TableField("start_time")
|
||||||
var startTime: LocalDateTime? = null
|
var startTime: LocalDateTime? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 结束时间
|
* End time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
*/
|
*/
|
||||||
@TableField("end_time")
|
@TableField("end_time")
|
||||||
var endTime: LocalDateTime? = null
|
var endTime: LocalDateTime? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行时间
|
* Execute time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("execute_time")
|
@TableField("execute_time")
|
||||||
var executeTime: Long? = null
|
var executeTime: Long? = null
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户代理
|
* User agent
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@TableField("user_agent")
|
@TableField("user_agent")
|
||||||
var userAgent: String? = null
|
var userAgent: String? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Operate username
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
var operateUsername: String? = null
|
var operateUsername: String? = null
|
||||||
|
|
||||||
|
|||||||
@@ -5,5 +5,6 @@ package top.fatweb.api.exception
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see RuntimeException
|
||||||
*/
|
*/
|
||||||
class NoRecordFoundException : RuntimeException("No record found")
|
class NoRecordFoundException : RuntimeException("No record found")
|
||||||
@@ -5,5 +5,6 @@ package top.fatweb.api.exception
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see RuntimeException
|
||||||
*/
|
*/
|
||||||
class TokenHasExpiredException : RuntimeException("Token has expired")
|
class TokenHasExpiredException : RuntimeException("Token has expired")
|
||||||
@@ -11,6 +11,7 @@ import org.springframework.stereotype.Component
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see Filter
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class ExceptionFilter : Filter {
|
class ExceptionFilter : Filter {
|
||||||
|
|||||||
@@ -20,13 +20,15 @@ import top.fatweb.api.util.WebUtil
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see RedisUtil
|
||||||
|
* @see OncePerRequestFilter
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class JwtAuthenticationTokenFilter(private val redisUtil: RedisUtil) : OncePerRequestFilter() {
|
class JwtAuthenticationTokenFilter(private val redisUtil: RedisUtil) : OncePerRequestFilter() {
|
||||||
override fun doFilterInternal(
|
override fun doFilterInternal(
|
||||||
request: HttpServletRequest, response: HttpServletResponse, filterChain: FilterChain
|
request: HttpServletRequest, response: HttpServletResponse, filterChain: FilterChain
|
||||||
) {
|
) {
|
||||||
val tokenWithPrefix = request.getHeader(SecurityProperties.headerString)
|
val tokenWithPrefix = request.getHeader(SecurityProperties.headerKey)
|
||||||
|
|
||||||
if (!StringUtils.hasText(tokenWithPrefix) || "/error/thrown" == request.servletPath) {
|
if (!StringUtils.hasText(tokenWithPrefix) || "/error/thrown" == request.servletPath) {
|
||||||
filterChain.doFilter(request, response)
|
filterChain.doFilter(request, response)
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import java.time.ZoneOffset
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see MetaObjectHandler
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class DataMetaObjectHandler : MetaObjectHandler {
|
class DataMetaObjectHandler : MetaObjectHandler {
|
||||||
|
|||||||
@@ -30,6 +30,16 @@ import top.fatweb.avatargenerator.AvatarException
|
|||||||
class ExceptionHandler {
|
class ExceptionHandler {
|
||||||
private val logger: Logger = LoggerFactory.getLogger(this::class.java)
|
private val logger: Logger = LoggerFactory.getLogger(this::class.java)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle all exception
|
||||||
|
*
|
||||||
|
* @param e Exception
|
||||||
|
* @return Response object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see Exception
|
||||||
|
* @see ResponseResult
|
||||||
|
*/
|
||||||
@ExceptionHandler(value = [Exception::class])
|
@ExceptionHandler(value = [Exception::class])
|
||||||
fun exceptionHandler(e: Exception): ResponseResult<*> {
|
fun exceptionHandler(e: Exception): ResponseResult<*> {
|
||||||
return when (e) {
|
return when (e) {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import org.springframework.stereotype.Component
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see AccessDeniedHandler
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class JwtAccessDeniedHandler : AccessDeniedHandler {
|
class JwtAccessDeniedHandler : AccessDeniedHandler {
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import org.springframework.stereotype.Component
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see AuthenticationEntryPoint
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
class JwtAuthenticationEntryPointHandler : AuthenticationEntryPoint {
|
class JwtAuthenticationEntryPointHandler : AuthenticationEntryPoint {
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ import java.util.concurrent.Executor
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see Executor
|
||||||
|
* @see ISysLogService
|
||||||
*/
|
*/
|
||||||
@ControllerAdvice
|
@ControllerAdvice
|
||||||
class SysLogInterceptor(
|
class SysLogInterceptor(
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import top.fatweb.api.entity.permission.Func
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see BaseMapper
|
||||||
|
* @see Func
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
interface FuncMapper : BaseMapper<Func>
|
interface FuncMapper : BaseMapper<Func>
|
||||||
|
|||||||
@@ -10,12 +10,43 @@ import top.fatweb.api.entity.permission.Group
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see BaseMapper
|
||||||
|
* @see Group
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
interface GroupMapper : BaseMapper<Group> {
|
interface GroupMapper : BaseMapper<Group> {
|
||||||
|
/**
|
||||||
|
* Select group in page
|
||||||
|
*
|
||||||
|
* @param page Pagination
|
||||||
|
* @param searchName Name to search for
|
||||||
|
* @param searchRegex Use regex
|
||||||
|
* @return Group in page
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see IPage
|
||||||
|
*/
|
||||||
fun selectPage(page: IPage<Long>, searchName: String?, searchRegex: Boolean): IPage<Long>
|
fun selectPage(page: IPage<Long>, searchName: String?, searchRegex: Boolean): IPage<Long>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Select group with role list by list of group IDs
|
||||||
|
*
|
||||||
|
* @param groupIds List of group IDs
|
||||||
|
* @return Group with role list
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see Group
|
||||||
|
*/
|
||||||
fun selectListWithRoleByIds(groupIds: List<Long>): List<Group>?
|
fun selectListWithRoleByIds(groupIds: List<Long>): List<Group>?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Select one group by ID
|
||||||
|
*
|
||||||
|
* @param id Group ID
|
||||||
|
* @return Group object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see Group
|
||||||
|
*/
|
||||||
fun selectOneById(id: Long): Group?
|
fun selectOneById(id: Long): Group?
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import top.fatweb.api.entity.permission.Menu
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see BaseMapper
|
||||||
|
* @see Menu
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
interface MenuMapper : BaseMapper<Menu>
|
interface MenuMapper : BaseMapper<Menu>
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import top.fatweb.api.entity.permission.Module
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see BaseMapper
|
||||||
|
* @see Module
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
interface ModuleMapper : BaseMapper<Module>
|
interface ModuleMapper : BaseMapper<Module>
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import top.fatweb.api.entity.permission.Operation
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see BaseMapper
|
||||||
|
* @see Operation
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
interface OperationMapper : BaseMapper<Operation>
|
interface OperationMapper : BaseMapper<Operation>
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import top.fatweb.api.entity.permission.Power
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see BaseMapper
|
||||||
|
* @see Power
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
interface PowerMapper : BaseMapper<Power>
|
interface PowerMapper : BaseMapper<Power>
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import top.fatweb.api.entity.permission.PowerRole
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see BaseMapper
|
||||||
|
* @see PowerRole
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
interface PowerRoleMapper : BaseMapper<PowerRole>
|
interface PowerRoleMapper : BaseMapper<PowerRole>
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import top.fatweb.api.entity.permission.RoleGroup
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see BaseMapper
|
||||||
|
* @see RoleGroup
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
interface RoleGroupMapper : BaseMapper<RoleGroup>
|
interface RoleGroupMapper : BaseMapper<RoleGroup>
|
||||||
|
|||||||
@@ -10,12 +10,43 @@ import top.fatweb.api.entity.permission.Role
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see BaseMapper
|
||||||
|
* @see Role
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
interface RoleMapper : BaseMapper<Role> {
|
interface RoleMapper : BaseMapper<Role> {
|
||||||
|
/**
|
||||||
|
* Select role in page
|
||||||
|
*
|
||||||
|
* @param page Pagination
|
||||||
|
* @param searchName Name to search for
|
||||||
|
* @param searchRegex Use regex
|
||||||
|
* @return Role in page
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see IPage
|
||||||
|
*/
|
||||||
fun selectPage(page: IPage<Long>, searchName: String?, searchRegex: Boolean): IPage<Long>
|
fun selectPage(page: IPage<Long>, searchName: String?, searchRegex: Boolean): IPage<Long>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Select role with power list by list of role IDs
|
||||||
|
*
|
||||||
|
* @param roleIds List of role IDs
|
||||||
|
* @return Role with power list
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see Role
|
||||||
|
*/
|
||||||
fun selectListWithPowerByIds(roleIds: List<Long>): List<Role>?
|
fun selectListWithPowerByIds(roleIds: List<Long>): List<Role>?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Select one role by ID
|
||||||
|
*
|
||||||
|
* @param id Role ID
|
||||||
|
* @return Role object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see Role
|
||||||
|
*/
|
||||||
fun selectOneById(id: Long): Role?
|
fun selectOneById(id: Long): Role?
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import top.fatweb.api.entity.permission.UserGroup
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see BaseMapper
|
||||||
|
* @see UserGroup
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
interface UserGroupMapper : BaseMapper<UserGroup>
|
interface UserGroupMapper : BaseMapper<UserGroup>
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import top.fatweb.api.entity.permission.UserInfo
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see BaseMapper
|
||||||
|
* @see UserInfo
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
interface UserInfoMapper : BaseMapper<UserInfo>
|
interface UserInfoMapper : BaseMapper<UserInfo>
|
||||||
|
|||||||
@@ -11,20 +11,85 @@ import top.fatweb.api.entity.permission.User
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see BaseMapper
|
||||||
|
* @see User
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
interface UserMapper : BaseMapper<User> {
|
interface UserMapper : BaseMapper<User> {
|
||||||
fun selectOneWithPowerInfoByUsername(@Param("username")username: String): User?
|
/**
|
||||||
|
* Select one user with power and information by username
|
||||||
|
*
|
||||||
|
* @param username Username
|
||||||
|
* @return User object with power and information
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see User
|
||||||
|
*/
|
||||||
|
fun selectOneWithPowerInfoByUsername(@Param("username") username: String): User?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Select user in page
|
||||||
|
*
|
||||||
|
* @param page Pagination
|
||||||
|
* @param searchType Type of search
|
||||||
|
* @param searchValue Value to search for
|
||||||
|
* @param searchRegex Use regex
|
||||||
|
* @return User in page
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see IPage
|
||||||
|
*/
|
||||||
fun selectPage(page: IPage<Long>, searchType: String, searchValue: String?, searchRegex: Boolean): IPage<Long>
|
fun selectPage(page: IPage<Long>, searchType: String, searchValue: String?, searchRegex: Boolean): IPage<Long>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Select user with role and information list by list of user IDs
|
||||||
|
*
|
||||||
|
* @param userIds List of user IDs
|
||||||
|
* @return User with role and information list
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see User
|
||||||
|
*/
|
||||||
fun selectListWithRoleInfoByIds(userIds: List<Long>): List<User>
|
fun selectListWithRoleInfoByIds(userIds: List<Long>): List<User>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Select one user by ID
|
||||||
|
*
|
||||||
|
* @param id User ID
|
||||||
|
* @return User object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see User
|
||||||
|
*/
|
||||||
fun selectOneWithRoleInfoById(id: Long): User?
|
fun selectOneWithRoleInfoById(id: Long): User?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Select all user with information list
|
||||||
|
*
|
||||||
|
* @return User with information list
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see User
|
||||||
|
*/
|
||||||
fun selectListWithInfo(): List<User>
|
fun selectListWithInfo(): List<User>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Select user IDs list by list of role IDs
|
||||||
|
*
|
||||||
|
* @param roleIds List of role IDs
|
||||||
|
* @return User IDs list
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
fun selectIdsWithRoleIds(roleIds: List<Long>): List<Long>
|
fun selectIdsWithRoleIds(roleIds: List<Long>): List<Long>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Select user IDs list by list of group IDs
|
||||||
|
*
|
||||||
|
* @param groupIds List of group IDs
|
||||||
|
* @return User IDs list
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
fun selectIdsWithGroupIds(groupIds: List<Long>): List<Long>
|
fun selectIdsWithGroupIds(groupIds: List<Long>): List<Long>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import top.fatweb.api.entity.permission.UserRole
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see BaseMapper
|
||||||
|
* @see UserRole
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
interface UserRoleMapper : BaseMapper<UserRole>
|
interface UserRoleMapper : BaseMapper<UserRole>
|
||||||
|
|||||||
@@ -11,9 +11,28 @@ import java.time.LocalDateTime
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see BaseMapper
|
||||||
|
* @see SysLog
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
interface SysLogMapper : BaseMapper<SysLog> {
|
interface SysLogMapper : BaseMapper<SysLog> {
|
||||||
|
/**
|
||||||
|
* Select system log in page
|
||||||
|
*
|
||||||
|
* @param page Pagination
|
||||||
|
* @param logType List of log types
|
||||||
|
* @param requestMethod List of request methods
|
||||||
|
* @param searchRequestUrl Request URL to search for
|
||||||
|
* @param searchRegex Use regex
|
||||||
|
* @param searchStartTime Start time to search for
|
||||||
|
* @param searchEndTime end time to search for
|
||||||
|
* @return System log in page
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see IPage
|
||||||
|
* @see SysLog
|
||||||
|
* @see LocalDateTime
|
||||||
|
*/
|
||||||
fun selectPage(
|
fun selectPage(
|
||||||
page: IPage<SysLog>,
|
page: IPage<SysLog>,
|
||||||
logType: List<String>?,
|
logType: List<String>?,
|
||||||
|
|||||||
@@ -4,23 +4,47 @@ import io.swagger.v3.oas.annotations.media.Schema
|
|||||||
import jakarta.validation.constraints.Min
|
import jakarta.validation.constraints.Min
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Page sort param
|
* Page sort parameters
|
||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
open class PageSortParam {
|
open class PageSortParam {
|
||||||
|
/**
|
||||||
|
* Current page number
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "分页页码", example = "1", defaultValue = "1")
|
@Schema(description = "分页页码", example = "1", defaultValue = "1")
|
||||||
@field:Min(1, message = "Pagination page number must be a positive integer")
|
@field:Min(1, message = "Pagination page number must be a positive integer")
|
||||||
var currentPage: Long = 1
|
var currentPage: Long = 1
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Size of page
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "分页大小", example = "20", defaultValue = "20")
|
@Schema(description = "分页大小", example = "20", defaultValue = "20")
|
||||||
@field:Min(1, message = "The number of data per page must be a positive integer")
|
@field:Min(1, message = "The number of data per page must be a positive integer")
|
||||||
var pageSize: Long = 20
|
var pageSize: Long = 20
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Field name to sort
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "排序字段", example = "id")
|
@Schema(description = "排序字段", example = "id")
|
||||||
var sortField: String? = null
|
var sortField: String? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sort order by
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "排序方式", example = "desc", allowableValues = ["desc", "asc"])
|
@Schema(description = "排序方式", example = "desc", allowableValues = ["desc", "asc"])
|
||||||
var sortOrder: String? = null
|
var sortOrder: String? = null
|
||||||
}
|
}
|
||||||
@@ -4,25 +4,66 @@ import io.swagger.v3.oas.annotations.media.Schema
|
|||||||
import jakarta.validation.constraints.Max
|
import jakarta.validation.constraints.Max
|
||||||
import jakarta.validation.constraints.Pattern
|
import jakarta.validation.constraints.Pattern
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Avatar base parameters
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
open class AvatarBaseParam {
|
open class AvatarBaseParam {
|
||||||
|
/**
|
||||||
|
* Seed to generate avatar
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "种子")
|
@Schema(description = "种子")
|
||||||
var seed: Long? = null
|
var seed: Long? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Size of image
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "图像大小", defaultValue = "128")
|
@Schema(description = "图像大小", defaultValue = "128")
|
||||||
@field:Max(256, message = "Size must be less than or equal to 256")
|
@field:Max(256, message = "Size must be less than or equal to 256")
|
||||||
var size: Int? = null
|
var size: Int? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Margin of image
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "外边距", defaultValue = "0")
|
@Schema(description = "外边距", defaultValue = "0")
|
||||||
var margin: Int? = null
|
var margin: Int? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Padding of image
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "内边距", defaultValue = "0")
|
@Schema(description = "内边距", defaultValue = "0")
|
||||||
var padding: Int? = null
|
var padding: Int? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of colors to generate avatar
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(defaultValue = "颜色列表", example = "#FFFFFFAA")
|
@Schema(defaultValue = "颜色列表", example = "#FFFFFFAA")
|
||||||
var colors: List<String>? = null
|
var colors: List<String>? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Background of image
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(defaultValue = "背景颜色", example = "#FFFFFFAA")
|
@Schema(defaultValue = "背景颜色", example = "#FFFFFFAA")
|
||||||
@field:Pattern(regexp = "^#[0-9a-fA-F]{6}|#[0-9a-fA-F]{8}$", message = "Background color must be a hex color code")
|
@field:Pattern(regexp = "^#[0-9a-fA-F]{6}|#[0-9a-fA-F]{8}$", message = "Background color must be a hex color code")
|
||||||
var background: String? = null
|
var background: String? = null
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
package top.fatweb.api.param.api.v1.avatar
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema
|
|
||||||
|
|
||||||
data class AvatarEightBitParam(
|
|
||||||
@Schema(description = "性别", defaultValue = "male", allowableValues = ["male", "female"])
|
|
||||||
val gender: String?,
|
|
||||||
) : AvatarBaseParam()
|
|
||||||
@@ -3,11 +3,29 @@ package top.fatweb.api.param.api.v1.avatar
|
|||||||
import io.swagger.v3.oas.annotations.media.Schema
|
import io.swagger.v3.oas.annotations.media.Schema
|
||||||
import jakarta.validation.constraints.Max
|
import jakarta.validation.constraints.Max
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GitHub style avatar parameters
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
data class AvatarGitHubParam(
|
data class AvatarGitHubParam(
|
||||||
|
/**
|
||||||
|
* Size of element
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "元素大小", defaultValue = "400")
|
@Schema(description = "元素大小", defaultValue = "400")
|
||||||
@field:Max(1000, message = "Element size must be less than or equal to 1000")
|
@field:Max(1000, message = "Element size must be less than or equal to 1000")
|
||||||
val elementSize: Int = 400,
|
val elementSize: Int = 400,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Precision of element
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "精确度", defaultValue = "5")
|
@Schema(description = "精确度", defaultValue = "5")
|
||||||
val precision: Int = 5
|
val precision: Int = 5
|
||||||
) : AvatarBaseParam()
|
) : AvatarBaseParam()
|
||||||
|
|||||||
@@ -4,17 +4,29 @@ import io.swagger.v3.oas.annotations.media.Schema
|
|||||||
import jakarta.validation.constraints.NotBlank
|
import jakarta.validation.constraints.NotBlank
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Login param
|
* Login parameters
|
||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@Schema(description = "登录请求参数")
|
@Schema(description = "登录请求参数")
|
||||||
data class LoginParam(
|
data class LoginParam(
|
||||||
|
/**
|
||||||
|
* Username
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "用户名", example = "test", required = true)
|
@Schema(description = "用户名", example = "test", required = true)
|
||||||
@field:NotBlank(message = "Username can not be blank")
|
@field:NotBlank(message = "Username can not be blank")
|
||||||
val username: String? = null,
|
val username: String? = null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Password
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "密码", example = "test123456", required = true)
|
@Schema(description = "密码", example = "test123456", required = true)
|
||||||
@field:NotBlank(message = "Password can not be blank")
|
@field:NotBlank(message = "Password can not be blank")
|
||||||
val password: String? = null
|
val password: String? = null
|
||||||
|
|||||||
@@ -4,20 +4,38 @@ import io.swagger.v3.oas.annotations.media.Schema
|
|||||||
import jakarta.validation.constraints.NotBlank
|
import jakarta.validation.constraints.NotBlank
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Group add param
|
* Add group parameters
|
||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@Schema(description = "用户组添加请求参数")
|
@Schema(description = "用户组添加请求参数")
|
||||||
data class GroupAddParam(
|
data class GroupAddParam(
|
||||||
|
/**
|
||||||
|
* Name
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "用户组名称")
|
@Schema(description = "用户组名称")
|
||||||
@field:NotBlank(message = "Name can not be blank")
|
@field:NotBlank(message = "Name can not be blank")
|
||||||
val name: String?,
|
val name: String?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
||||||
val enable: Boolean = true,
|
val enable: Boolean = true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of role IDs
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "角色 ID 列表")
|
@Schema(description = "角色 ID 列表")
|
||||||
val roleIds: List<Long>? = null
|
val roleIds: List<Long>? = null
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,13 +3,19 @@ package top.fatweb.api.param.permission.group
|
|||||||
import io.swagger.v3.oas.annotations.media.Schema
|
import io.swagger.v3.oas.annotations.media.Schema
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Group delete param
|
* Delete group parameters
|
||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@Schema(description = "用户组删除请求参数")
|
@Schema(description = "用户组删除请求参数")
|
||||||
data class GroupDeleteParam(
|
data class GroupDeleteParam(
|
||||||
|
/**
|
||||||
|
* List of group IDs
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "用户组 ID 列表")
|
@Schema(description = "用户组 ID 列表")
|
||||||
val ids: List<Long>
|
val ids: List<Long>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,16 +4,29 @@ import io.swagger.v3.oas.annotations.media.Schema
|
|||||||
import top.fatweb.api.param.PageSortParam
|
import top.fatweb.api.param.PageSortParam
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Group get param
|
* Get group parameters
|
||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see PageSortParam
|
||||||
*/
|
*/
|
||||||
@Schema(description = "用户组查询请求参数")
|
@Schema(description = "用户组查询请求参数")
|
||||||
data class GroupGetParam(
|
data class GroupGetParam(
|
||||||
|
/**
|
||||||
|
* Name to search for
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "查询用户组名称")
|
@Schema(description = "查询用户组名称")
|
||||||
val searchName: String? = null,
|
val searchName: String? = null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use regex
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "查询使用正则表达式", allowableValues = ["true", "false"], defaultValue = "false")
|
@Schema(description = "查询使用正则表达式", allowableValues = ["true", "false"], defaultValue = "false")
|
||||||
val searchRegex: Boolean = false,
|
val searchRegex: Boolean = false,
|
||||||
) : PageSortParam()
|
) : PageSortParam()
|
||||||
|
|||||||
@@ -5,24 +5,48 @@ import jakarta.validation.constraints.NotBlank
|
|||||||
import jakarta.validation.constraints.NotNull
|
import jakarta.validation.constraints.NotNull
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Group update param
|
* Update group parameters
|
||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@Schema(description = "用户组更新请求参数")
|
@Schema(description = "用户组更新请求参数")
|
||||||
data class GroupUpdateParam(
|
data class GroupUpdateParam(
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "用户组 ID")
|
@Schema(description = "用户组 ID")
|
||||||
@field:NotNull(message = "ID can not be null")
|
@field:NotNull(message = "ID can not be null")
|
||||||
val id: Long?,
|
val id: Long?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Name
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "用户组名称")
|
@Schema(description = "用户组名称")
|
||||||
@field:NotBlank(message = "Name can not be blank")
|
@field:NotBlank(message = "Name can not be blank")
|
||||||
val name: String?,
|
val name: String?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
||||||
val enable: Boolean = true,
|
val enable: Boolean = true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of role IDs
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "角色 ID 列表")
|
@Schema(description = "角色 ID 列表")
|
||||||
val roleIds: List<Long>? = null
|
val roleIds: List<Long>? = null
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,17 +4,29 @@ import io.swagger.v3.oas.annotations.media.Schema
|
|||||||
import jakarta.validation.constraints.NotNull
|
import jakarta.validation.constraints.NotNull
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Group change status param
|
* Update status of group parameters
|
||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@Schema(description = "用户组更改状态请求参数")
|
@Schema(description = "用户组更改状态请求参数")
|
||||||
data class GroupUpdateStatusParam(
|
data class GroupUpdateStatusParam(
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "用户组 ID")
|
@Schema(description = "用户组 ID")
|
||||||
@field:NotNull(message = "ID can not be null")
|
@field:NotNull(message = "ID can not be null")
|
||||||
val id: Long?,
|
val id: Long?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
||||||
val enable: Boolean = true
|
val enable: Boolean = true
|
||||||
)
|
)
|
||||||
@@ -4,20 +4,38 @@ import io.swagger.v3.oas.annotations.media.Schema
|
|||||||
import jakarta.validation.constraints.NotBlank
|
import jakarta.validation.constraints.NotBlank
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Role add param
|
* Add role parameters
|
||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@Schema(description = "角色添加请求参数")
|
@Schema(description = "角色添加请求参数")
|
||||||
data class RoleAddParam(
|
data class RoleAddParam(
|
||||||
|
/**
|
||||||
|
* Name
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "角色名称")
|
@Schema(description = "角色名称")
|
||||||
@field:NotBlank(message = "Name can not be blank")
|
@field:NotBlank(message = "Name can not be blank")
|
||||||
val name: String?,
|
val name: String?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
||||||
val enable: Boolean = true,
|
val enable: Boolean = true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of power IDs
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "权限 ID 列表")
|
@Schema(description = "权限 ID 列表")
|
||||||
val powerIds: List<Long>? = null
|
val powerIds: List<Long>? = null
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,13 +3,19 @@ package top.fatweb.api.param.permission.role
|
|||||||
import io.swagger.v3.oas.annotations.media.Schema
|
import io.swagger.v3.oas.annotations.media.Schema
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Role delete param
|
* Delete role parameters
|
||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@Schema(description = "角色删除请求参数")
|
@Schema(description = "角色删除请求参数")
|
||||||
data class RoleDeleteParam(
|
data class RoleDeleteParam(
|
||||||
|
/**
|
||||||
|
* List of role IDs
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "角色 ID 列表")
|
@Schema(description = "角色 ID 列表")
|
||||||
val ids: List<Long>
|
val ids: List<Long>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,16 +4,29 @@ import io.swagger.v3.oas.annotations.media.Schema
|
|||||||
import top.fatweb.api.param.PageSortParam
|
import top.fatweb.api.param.PageSortParam
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Role get param
|
* Get role parameters
|
||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see PageSortParam
|
||||||
*/
|
*/
|
||||||
@Schema(description = "角色查询请求参数")
|
@Schema(description = "角色查询请求参数")
|
||||||
data class RoleGetParam(
|
data class RoleGetParam(
|
||||||
|
/**
|
||||||
|
* Name to search for
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "查询角色名称")
|
@Schema(description = "查询角色名称")
|
||||||
val searchName: String? = null,
|
val searchName: String? = null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use regex
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "查询使用正则表达式", allowableValues = ["true", "false"], defaultValue = "false")
|
@Schema(description = "查询使用正则表达式", allowableValues = ["true", "false"], defaultValue = "false")
|
||||||
val searchRegex: Boolean = false,
|
val searchRegex: Boolean = false,
|
||||||
) : PageSortParam()
|
) : PageSortParam()
|
||||||
|
|||||||
@@ -5,24 +5,48 @@ import jakarta.validation.constraints.NotBlank
|
|||||||
import jakarta.validation.constraints.NotNull
|
import jakarta.validation.constraints.NotNull
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Role update param
|
* Update role parameters
|
||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@Schema(description = "角色更新请求参数")
|
@Schema(description = "角色更新请求参数")
|
||||||
data class RoleUpdateParam(
|
data class RoleUpdateParam(
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "角色 ID")
|
@Schema(description = "角色 ID")
|
||||||
@field:NotNull(message = "Role id can not be null")
|
@field:NotNull(message = "Role id can not be null")
|
||||||
val id: Long?,
|
val id: Long?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Name
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "角色名称")
|
@Schema(description = "角色名称")
|
||||||
@field:NotBlank(message = "Name can not be blank")
|
@field:NotBlank(message = "Name can not be blank")
|
||||||
val name: String?,
|
val name: String?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
||||||
val enable: Boolean = true,
|
val enable: Boolean = true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of power IDs
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "权限 ID 列表")
|
@Schema(description = "权限 ID 列表")
|
||||||
val powerIds: List<Long>? = null
|
val powerIds: List<Long>? = null
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,17 +4,29 @@ import io.swagger.v3.oas.annotations.media.Schema
|
|||||||
import jakarta.validation.constraints.NotNull
|
import jakarta.validation.constraints.NotNull
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Role change status param
|
* Update status of role parameters
|
||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@Schema(description = "角色更改状态请求参数")
|
@Schema(description = "角色更改状态请求参数")
|
||||||
data class RoleUpdateStatusParam(
|
data class RoleUpdateStatusParam(
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "角色 ID")
|
@Schema(description = "角色 ID")
|
||||||
@field:NotNull(message = "Role id can not be null")
|
@field:NotNull(message = "Role id can not be null")
|
||||||
val id: Long?,
|
val id: Long?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
||||||
val enable: Boolean = true
|
val enable: Boolean = true
|
||||||
)
|
)
|
||||||
@@ -4,39 +4,113 @@ import io.swagger.v3.oas.annotations.media.Schema
|
|||||||
import jakarta.validation.constraints.NotBlank
|
import jakarta.validation.constraints.NotBlank
|
||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add user parameters
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "用户添加请求参数")
|
@Schema(description = "用户添加请求参数")
|
||||||
data class UserAddParam(
|
data class UserAddParam(
|
||||||
|
/**
|
||||||
|
* Username
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "用户名")
|
@Schema(description = "用户名")
|
||||||
@field:NotBlank(message = "Username can not be blank")
|
@field:NotBlank(message = "Username can not be blank")
|
||||||
val username: String?,
|
val username: String?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Password
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "密码(为空自动生成随机密码)")
|
@Schema(description = "密码(为空自动生成随机密码)")
|
||||||
val password: String?,
|
val password: String?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Locking
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "锁定", allowableValues = ["true", "false"], defaultValue = "false")
|
@Schema(description = "锁定", allowableValues = ["true", "false"], defaultValue = "false")
|
||||||
val locking: Boolean = false,
|
val locking: Boolean = false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Expiration time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
|
*/
|
||||||
@Schema(description = "过期时间")
|
@Schema(description = "过期时间")
|
||||||
val expiration: LocalDateTime?,
|
val expiration: LocalDateTime?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Credentials expiration time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
|
*/
|
||||||
@Schema(description = "认证过期时间")
|
@Schema(description = "认证过期时间")
|
||||||
val credentialsExpiration: LocalDateTime?,
|
val credentialsExpiration: LocalDateTime?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
||||||
val enable: Boolean = true,
|
val enable: Boolean = true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Nickname
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "昵称")
|
@Schema(description = "昵称")
|
||||||
val nickname: String?,
|
val nickname: String?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Avatar base63
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "头像")
|
@Schema(description = "头像")
|
||||||
val avatar: String?,
|
val avatar: String?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Email
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "邮箱")
|
@Schema(description = "邮箱")
|
||||||
val email: String?,
|
val email: String?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of role IDs
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "角色 ID 列表")
|
@Schema(description = "角色 ID 列表")
|
||||||
val roleIds: List<Long>?,
|
val roleIds: List<Long>?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of group IDs
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "用户组 ID 列表")
|
@Schema(description = "用户组 ID 列表")
|
||||||
val groupIds: List<Long>?
|
val groupIds: List<Long>?
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,13 +3,19 @@ package top.fatweb.api.param.permission.user
|
|||||||
import io.swagger.v3.oas.annotations.media.Schema
|
import io.swagger.v3.oas.annotations.media.Schema
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User delete param
|
* Delete user parameters
|
||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
@Schema(description = "用户删除请求参数")
|
@Schema(description = "用户删除请求参数")
|
||||||
data class UserDeleteParam(
|
data class UserDeleteParam(
|
||||||
|
/**
|
||||||
|
* List of user IDs
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "用户 ID 列表")
|
@Schema(description = "用户 ID 列表")
|
||||||
val ids: List<Long>
|
val ids: List<Long>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,19 +4,38 @@ import io.swagger.v3.oas.annotations.media.Schema
|
|||||||
import top.fatweb.api.param.PageSortParam
|
import top.fatweb.api.param.PageSortParam
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User get param
|
* Get user parameters
|
||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see PageSortParam
|
||||||
*/
|
*/
|
||||||
@Schema(description = "用户查询请求参数")
|
@Schema(description = "用户查询请求参数")
|
||||||
data class UserGetParam(
|
data class UserGetParam(
|
||||||
|
/**
|
||||||
|
* Type of search
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "搜索类型", allowableValues = ["ALL", "ID", "USERNAME", "NICKNAME", "EMAIL"], defaultValue = "ALL")
|
@Schema(description = "搜索类型", allowableValues = ["ALL", "ID", "USERNAME", "NICKNAME", "EMAIL"], defaultValue = "ALL")
|
||||||
val searchType: String = "ALL",
|
val searchType: String = "ALL",
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Value to search for
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "查询内容")
|
@Schema(description = "查询内容")
|
||||||
val searchValue: String? = null,
|
val searchValue: String? = null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use regex
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "查询使用正则表达式", allowableValues = ["true", "false"], defaultValue = "false")
|
@Schema(description = "查询使用正则表达式", allowableValues = ["true", "false"], defaultValue = "false")
|
||||||
val searchRegex: Boolean = false,
|
val searchRegex: Boolean = false,
|
||||||
) : PageSortParam()
|
) : PageSortParam()
|
||||||
|
|||||||
@@ -4,39 +4,113 @@ import io.swagger.v3.oas.annotations.media.Schema
|
|||||||
import jakarta.validation.constraints.NotNull
|
import jakarta.validation.constraints.NotNull
|
||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update user parameters
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "用户更新请求参数")
|
@Schema(description = "用户更新请求参数")
|
||||||
data class UserUpdateParam(
|
data class UserUpdateParam(
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "用户 ID")
|
@Schema(description = "用户 ID")
|
||||||
@field:NotNull(message = "ID can not be null")
|
@field:NotNull(message = "ID can not be null")
|
||||||
val id: Long?,
|
val id: Long?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Username
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "用户名")
|
@Schema(description = "用户名")
|
||||||
val username: String?,
|
val username: String?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Locking
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "锁定", allowableValues = ["true", "false"], defaultValue = "false")
|
@Schema(description = "锁定", allowableValues = ["true", "false"], defaultValue = "false")
|
||||||
val locking: Boolean = false,
|
val locking: Boolean = false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Expiration time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
|
*/
|
||||||
@Schema(description = "过期时间")
|
@Schema(description = "过期时间")
|
||||||
val expiration: LocalDateTime?,
|
val expiration: LocalDateTime?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Credentials expiration time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
|
*/
|
||||||
@Schema(description = "认证过期时间")
|
@Schema(description = "认证过期时间")
|
||||||
val credentialsExpiration: LocalDateTime?,
|
val credentialsExpiration: LocalDateTime?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
||||||
val enable: Boolean = true,
|
val enable: Boolean = true,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Nickname
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "昵称")
|
@Schema(description = "昵称")
|
||||||
val nickname: String?,
|
val nickname: String?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Avatar base64
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "头像")
|
@Schema(description = "头像")
|
||||||
val avatar: String?,
|
val avatar: String?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Email
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "邮箱")
|
@Schema(description = "邮箱")
|
||||||
val email: String?,
|
val email: String?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of role IDs
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "角色 ID 列表")
|
@Schema(description = "角色 ID 列表")
|
||||||
val roleIds: List<Long>?,
|
val roleIds: List<Long>?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of group IDs
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "用户组 ID 列表")
|
@Schema(description = "用户组 ID 列表")
|
||||||
val groupIds: List<Long>?
|
val groupIds: List<Long>?
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -5,16 +5,41 @@ import jakarta.validation.constraints.NotBlank
|
|||||||
import jakarta.validation.constraints.NotNull
|
import jakarta.validation.constraints.NotNull
|
||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update password of user parameters
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "用户更改密码请求参数")
|
@Schema(description = "用户更改密码请求参数")
|
||||||
data class UserUpdatePasswordParam(
|
data class UserUpdatePasswordParam(
|
||||||
|
/**
|
||||||
|
* ID
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "用户 ID")
|
@Schema(description = "用户 ID")
|
||||||
@field:NotNull(message = "ID can not be null")
|
@field:NotNull(message = "ID can not be null")
|
||||||
val id: Long?,
|
val id: Long?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* New password
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "新密码")
|
@Schema(description = "新密码")
|
||||||
@field:NotBlank(message = "Password can not be blank")
|
@field:NotBlank(message = "Password can not be blank")
|
||||||
val password: String?,
|
val password: String?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Credentials expiration time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
|
*/
|
||||||
@Schema(description = "认证过期时间")
|
@Schema(description = "认证过期时间")
|
||||||
val credentialsExpiration: LocalDateTime?
|
val credentialsExpiration: LocalDateTime?
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,9 +1,57 @@
|
|||||||
package top.fatweb.api.param.system
|
package top.fatweb.api.param.system
|
||||||
|
|
||||||
data class MailSettingsParam (
|
import io.swagger.v3.oas.annotations.media.Schema
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mail settings parameters
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
@Schema(description = "邮件设置请求参数")
|
||||||
|
data class MailSettingsParam(
|
||||||
|
/**
|
||||||
|
* Host
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
@Schema(description = "SMTP 服务器")
|
||||||
val host: String?,
|
val host: String?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Port
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
@Schema(description = "端口号")
|
||||||
val port: Int?,
|
val port: Int?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Username
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
@Schema(description = "用户名")
|
||||||
val username: String?,
|
val username: String?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Password
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
@Schema(description = "密码")
|
||||||
val password: String?,
|
val password: String?,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sender
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
@Schema(description = "发送者")
|
||||||
val from: String?
|
val from: String?
|
||||||
)
|
)
|
||||||
@@ -6,16 +6,29 @@ import top.fatweb.api.param.PageSortParam
|
|||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* System log get param
|
* Get system log parameters
|
||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see PageSortParam
|
||||||
*/
|
*/
|
||||||
@Schema(description = "获取系统日志请求参数")
|
@Schema(description = "获取系统日志请求参数")
|
||||||
data class SysLogGetParam(
|
data class SysLogGetParam(
|
||||||
|
/**
|
||||||
|
* Log type
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "类型过滤(多个使用逗号分隔)", example = "INFO", allowableValues = ["INFO", "ERROR"])
|
@Schema(description = "类型过滤(多个使用逗号分隔)", example = "INFO", allowableValues = ["INFO", "ERROR"])
|
||||||
val logType: String? = null,
|
val logType: String? = null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request method to filter
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(
|
@Schema(
|
||||||
description = "请求方式过滤(多个使用逗号分隔)",
|
description = "请求方式过滤(多个使用逗号分隔)",
|
||||||
example = "GET,POST",
|
example = "GET,POST",
|
||||||
@@ -23,16 +36,42 @@ data class SysLogGetParam(
|
|||||||
)
|
)
|
||||||
val requestMethod: String? = null,
|
val requestMethod: String? = null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Request URL to search for
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "查询请求 Url")
|
@Schema(description = "查询请求 Url")
|
||||||
val searchRequestUrl: String? = null,
|
val searchRequestUrl: String? = null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use regex
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
@Schema(description = "查询使用正则表达式", allowableValues = ["true", "false"], defaultValue = "false")
|
@Schema(description = "查询使用正则表达式", allowableValues = ["true", "false"], defaultValue = "false")
|
||||||
val searchRegex: Boolean = false,
|
val searchRegex: Boolean = false,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Start time to search for
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
|
*/
|
||||||
@Schema(description = "查询开始时间")
|
@Schema(description = "查询开始时间")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||||
val searchStartTime: LocalDateTime? = null,
|
val searchStartTime: LocalDateTime? = null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* End time to search for
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see LocalDateTime
|
||||||
|
*/
|
||||||
@Schema(description = "查询结束时间")
|
@Schema(description = "查询结束时间")
|
||||||
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
@DateTimeFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
|
||||||
val searchEndTime: LocalDateTime? = null
|
val searchEndTime: LocalDateTime? = null
|
||||||
|
|||||||
@@ -12,8 +12,35 @@ import org.springframework.stereotype.Component
|
|||||||
@Component
|
@Component
|
||||||
@ConfigurationProperties("app.admin")
|
@ConfigurationProperties("app.admin")
|
||||||
object AdminProperties {
|
object AdminProperties {
|
||||||
|
/**
|
||||||
|
* Username
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
var username = "admin"
|
var username = "admin"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Password
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
var password: String? = null
|
var password: String? = null
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Nickname
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
var nickname = "Administrator"
|
var nickname = "Administrator"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Email
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
var email = "admin@fatweb.top"
|
var email = "admin@fatweb.top"
|
||||||
}
|
}
|
||||||
@@ -13,19 +13,67 @@ import java.util.concurrent.TimeUnit
|
|||||||
@Component
|
@Component
|
||||||
@ConfigurationProperties("app.security")
|
@ConfigurationProperties("app.security")
|
||||||
object SecurityProperties {
|
object SecurityProperties {
|
||||||
var headerString = "Authorization"
|
/**
|
||||||
|
* Key to get authentication from header
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
var headerKey = "Authorization"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prefix of token
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
var tokenPrefix = "Bearer "
|
var tokenPrefix = "Bearer "
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TTL of JWT
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
var jwtTtl = 2L
|
var jwtTtl = 2L
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TTL unit of JWT
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
var jwtTtlUnit = TimeUnit.HOURS
|
var jwtTtlUnit = TimeUnit.HOURS
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Key of JWT
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
var jwtKey = "FatWeb"
|
var jwtKey = "FatWeb"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Issuer of JWT
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
var jwtIssuer = "FatWeb"
|
var jwtIssuer = "FatWeb"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TTL of redis
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
var redisTtl = 20L
|
var redisTtl = 20L
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TTL unit of redis
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
var redisTtlUnit = TimeUnit.MINUTES
|
var redisTtlUnit = TimeUnit.MINUTES
|
||||||
}
|
}
|
||||||
@@ -15,8 +15,20 @@ import java.time.ZonedDateTime
|
|||||||
@Component
|
@Component
|
||||||
@ConfigurationProperties("app")
|
@ConfigurationProperties("app")
|
||||||
object ServerProperties {
|
object ServerProperties {
|
||||||
|
/**
|
||||||
|
* Version
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
lateinit var version: String
|
lateinit var version: String
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build time
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
lateinit var buildTime: String
|
lateinit var buildTime: String
|
||||||
|
|
||||||
fun buildZoneDateTime(zoneId: ZoneId = ZoneId.systemDefault()): ZonedDateTime =
|
fun buildZoneDateTime(zoneId: ZoneId = ZoneId.systemDefault()): ZonedDateTime =
|
||||||
|
|||||||
@@ -4,23 +4,106 @@ import top.fatweb.api.param.api.v1.avatar.AvatarBaseParam
|
|||||||
import top.fatweb.api.param.api.v1.avatar.AvatarGitHubParam
|
import top.fatweb.api.param.api.v1.avatar.AvatarGitHubParam
|
||||||
import top.fatweb.api.vo.api.v1.avatar.AvatarBase64Vo
|
import top.fatweb.api.vo.api.v1.avatar.AvatarBase64Vo
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Avatar service interface
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
interface IAvatarService {
|
interface IAvatarService {
|
||||||
|
/**
|
||||||
|
* Generate triangle style avatar
|
||||||
|
*
|
||||||
|
* @param avatarBaseParam Avatar base parameters
|
||||||
|
* @return Avatar byte array
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see AvatarBaseParam
|
||||||
|
* @see ByteArray
|
||||||
|
*/
|
||||||
fun triangle(avatarBaseParam: AvatarBaseParam?): ByteArray
|
fun triangle(avatarBaseParam: AvatarBaseParam?): ByteArray
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate triangle style avatar as base64
|
||||||
|
*
|
||||||
|
* @param avatarBaseParam Avatar base parameters
|
||||||
|
* @return AvatarBase64Vo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see AvatarBaseParam
|
||||||
|
* @see AvatarBase64Vo
|
||||||
|
*/
|
||||||
fun triangleBase64(avatarBaseParam: AvatarBaseParam?): AvatarBase64Vo
|
fun triangleBase64(avatarBaseParam: AvatarBaseParam?): AvatarBase64Vo
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate square style avatar
|
||||||
|
*
|
||||||
|
* @param avatarBaseParam Avatar base parameters
|
||||||
|
* @return Avatar byte array
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see AvatarBaseParam
|
||||||
|
* @see ByteArray
|
||||||
|
*/
|
||||||
fun square(avatarBaseParam: AvatarBaseParam?): ByteArray
|
fun square(avatarBaseParam: AvatarBaseParam?): ByteArray
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate square style avatar as base64
|
||||||
|
*
|
||||||
|
* @param avatarBaseParam Avatar base parameters
|
||||||
|
* @return AvatarBase64Vo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see AvatarBaseParam
|
||||||
|
* @see AvatarBase64Vo
|
||||||
|
*/
|
||||||
fun squareBase64(avatarBaseParam: AvatarBaseParam?): AvatarBase64Vo
|
fun squareBase64(avatarBaseParam: AvatarBaseParam?): AvatarBase64Vo
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate identicon style avatar
|
||||||
|
*
|
||||||
|
* @param avatarBaseParam Avatar base parameters
|
||||||
|
* @return Avatar byte array
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see AvatarBaseParam
|
||||||
|
* @see ByteArray
|
||||||
|
*/
|
||||||
fun identicon(avatarBaseParam: AvatarBaseParam?): ByteArray
|
fun identicon(avatarBaseParam: AvatarBaseParam?): ByteArray
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate identicon style avatar as base64
|
||||||
|
*
|
||||||
|
* @param avatarBaseParam Avatar base parameters
|
||||||
|
* @return AvatarBase64Vo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see AvatarBaseParam
|
||||||
|
* @see AvatarBase64Vo
|
||||||
|
*/
|
||||||
fun identiconBase64(avatarBaseParam: AvatarBaseParam?): AvatarBase64Vo
|
fun identiconBase64(avatarBaseParam: AvatarBaseParam?): AvatarBase64Vo
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate GitHub style avatar
|
||||||
|
*
|
||||||
|
* @param avatarGitHubParam Avatar base parameters
|
||||||
|
* @return Avatar byte array
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see AvatarBaseParam
|
||||||
|
* @see ByteArray
|
||||||
|
*/
|
||||||
fun github(avatarGitHubParam: AvatarGitHubParam?): ByteArray
|
fun github(avatarGitHubParam: AvatarGitHubParam?): ByteArray
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate GitHub style avatar as base64
|
||||||
|
*
|
||||||
|
* @param avatarGitHubParam Avatar base parameters
|
||||||
|
* @return AvatarBase64Vo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see AvatarBaseParam
|
||||||
|
* @see AvatarBase64Vo
|
||||||
|
*/
|
||||||
fun githubBase64(avatarGitHubParam: AvatarGitHubParam?): AvatarBase64Vo
|
fun githubBase64(avatarGitHubParam: AvatarGitHubParam?): AvatarBase64Vo
|
||||||
|
|
||||||
// fun eightBit(avatarEightBitParam: AvatarEightBitParam?): ByteArray
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -15,6 +15,13 @@ import java.awt.Color
|
|||||||
import kotlin.io.encoding.Base64
|
import kotlin.io.encoding.Base64
|
||||||
import kotlin.io.encoding.ExperimentalEncodingApi
|
import kotlin.io.encoding.ExperimentalEncodingApi
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Avatar service implement
|
||||||
|
*
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see IAvatarService
|
||||||
|
*/
|
||||||
@OptIn(ExperimentalEncodingApi::class)
|
@OptIn(ExperimentalEncodingApi::class)
|
||||||
@Service
|
@Service
|
||||||
class AvatarServiceImpl : IAvatarService {
|
class AvatarServiceImpl : IAvatarService {
|
||||||
|
|||||||
@@ -12,9 +12,38 @@ import top.fatweb.api.vo.permission.TokenVo
|
|||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
interface IAuthenticationService {
|
interface IAuthenticationService {
|
||||||
|
/**
|
||||||
|
* Login
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param user User object
|
||||||
|
* @return LoginVo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see HttpServletRequest
|
||||||
|
* @see User
|
||||||
|
* @see LoginVo
|
||||||
|
*/
|
||||||
fun login(request: HttpServletRequest, user: User): LoginVo
|
fun login(request: HttpServletRequest, user: User): LoginVo
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Logout
|
||||||
|
*
|
||||||
|
* @param token Token
|
||||||
|
* @return Logout result
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
fun logout(token: String): Boolean
|
fun logout(token: String): Boolean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renew token
|
||||||
|
*
|
||||||
|
* @param token Token
|
||||||
|
* @return TokenVo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see TokenVo
|
||||||
|
*/
|
||||||
fun renewToken(token: String): TokenVo
|
fun renewToken(token: String): TokenVo
|
||||||
}
|
}
|
||||||
@@ -8,5 +8,7 @@ import top.fatweb.api.entity.permission.Func
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see IService
|
||||||
|
* @see Func
|
||||||
*/
|
*/
|
||||||
interface IFuncService : IService<Func>
|
interface IFuncService : IService<Func>
|
||||||
|
|||||||
@@ -12,21 +12,95 @@ import top.fatweb.api.vo.permission.GroupWithRoleVo
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see IService
|
||||||
|
* @see Group
|
||||||
*/
|
*/
|
||||||
interface IGroupService : IService<Group> {
|
interface IGroupService : IService<Group> {
|
||||||
|
/**
|
||||||
|
* Get group in page
|
||||||
|
*
|
||||||
|
* @param groupGetParam Get group parameters
|
||||||
|
* @return PageVo<GroupWithRoleVo> object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see GroupGetParam
|
||||||
|
* @see PageVo
|
||||||
|
* @see GroupWithRoleVo
|
||||||
|
*/
|
||||||
fun getPage(groupGetParam: GroupGetParam?): PageVo<GroupWithRoleVo>
|
fun getPage(groupGetParam: GroupGetParam?): PageVo<GroupWithRoleVo>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get one group by ID
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @return GroupWithRoleVo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see GroupWithRoleVo
|
||||||
|
*/
|
||||||
fun getOne(id: Long): GroupWithRoleVo?
|
fun getOne(id: Long): GroupWithRoleVo?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all group in list
|
||||||
|
*
|
||||||
|
* @return List of GroupVo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see GroupVo
|
||||||
|
*/
|
||||||
fun listAll(): List<GroupVo>
|
fun listAll(): List<GroupVo>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add group
|
||||||
|
*
|
||||||
|
* @param groupAddParam Add group parameters
|
||||||
|
* @return GroupVo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see GroupAddParam
|
||||||
|
* @see GroupVo
|
||||||
|
*/
|
||||||
fun add(groupAddParam: GroupAddParam): GroupVo?
|
fun add(groupAddParam: GroupAddParam): GroupVo?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update group
|
||||||
|
*
|
||||||
|
* @param groupUpdateParam Update group parameters
|
||||||
|
* @return GroupVo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see GroupUpdateParam
|
||||||
|
* @see GroupVo
|
||||||
|
*/
|
||||||
fun update(groupUpdateParam: GroupUpdateParam): GroupVo?
|
fun update(groupUpdateParam: GroupUpdateParam): GroupVo?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update status of group
|
||||||
|
*
|
||||||
|
* @param groupUpdateStatusParam Update status of group parameters
|
||||||
|
* @return Result
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see GroupUpdateStatusParam
|
||||||
|
*/
|
||||||
fun status(groupUpdateStatusParam: GroupUpdateStatusParam): Boolean
|
fun status(groupUpdateStatusParam: GroupUpdateStatusParam): Boolean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete group by ID
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
fun deleteOne(id: Long)
|
fun deleteOne(id: Long)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete group by list
|
||||||
|
*
|
||||||
|
* @param groupDeleteParam Delete group parameters
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see GroupDeleteParam
|
||||||
|
*/
|
||||||
fun delete(groupDeleteParam: GroupDeleteParam)
|
fun delete(groupDeleteParam: GroupDeleteParam)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,5 +8,7 @@ import top.fatweb.api.entity.permission.Menu
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see IService
|
||||||
|
* @see Menu
|
||||||
*/
|
*/
|
||||||
interface IMenuService : IService<Menu>
|
interface IMenuService : IService<Menu>
|
||||||
|
|||||||
@@ -8,5 +8,7 @@ import top.fatweb.api.entity.permission.Module
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see IService
|
||||||
|
* @see Module
|
||||||
*/
|
*/
|
||||||
interface IModuleService : IService<Module>
|
interface IModuleService : IService<Module>
|
||||||
|
|||||||
@@ -8,5 +8,7 @@ import top.fatweb.api.entity.permission.Operation
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see IService
|
||||||
|
* @see Operation
|
||||||
*/
|
*/
|
||||||
interface IOperationService : IService<Operation>
|
interface IOperationService : IService<Operation>
|
||||||
|
|||||||
@@ -8,5 +8,7 @@ import top.fatweb.api.entity.permission.PowerRole
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see IService
|
||||||
|
* @see PowerRole
|
||||||
*/
|
*/
|
||||||
interface IPowerRoleService : IService<PowerRole>
|
interface IPowerRoleService : IService<PowerRole>
|
||||||
|
|||||||
@@ -9,7 +9,17 @@ import top.fatweb.api.vo.permission.PowerSetVo
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see IService
|
||||||
|
* @see Power
|
||||||
*/
|
*/
|
||||||
interface IPowerService : IService<Power> {
|
interface IPowerService : IService<Power> {
|
||||||
|
/**
|
||||||
|
* Get all power as list
|
||||||
|
*
|
||||||
|
* @return powerSetVo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see PowerSetVo
|
||||||
|
*/
|
||||||
fun getList(): PowerSetVo
|
fun getList(): PowerSetVo
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,5 +8,7 @@ import top.fatweb.api.entity.permission.RoleGroup
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see IService
|
||||||
|
* @see RoleGroup
|
||||||
*/
|
*/
|
||||||
interface IRoleGroupService : IService<RoleGroup>
|
interface IRoleGroupService : IService<RoleGroup>
|
||||||
|
|||||||
@@ -12,21 +12,95 @@ import top.fatweb.api.vo.permission.RoleWithPowerVo
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see IService
|
||||||
|
* @see Role
|
||||||
*/
|
*/
|
||||||
interface IRoleService : IService<Role> {
|
interface IRoleService : IService<Role> {
|
||||||
|
/**
|
||||||
|
* Get role in page
|
||||||
|
*
|
||||||
|
* @param roleGetParam Get role parameters
|
||||||
|
* @return PageVo<RoleWithPowerVo> object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see RoleGetParam
|
||||||
|
* @see PageVo
|
||||||
|
* @see RoleWithPowerVo
|
||||||
|
*/
|
||||||
fun getPage(roleGetParam: RoleGetParam?): PageVo<RoleWithPowerVo>
|
fun getPage(roleGetParam: RoleGetParam?): PageVo<RoleWithPowerVo>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get user by ID
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @return RoleWithPowerVo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see RoleWithPowerVo
|
||||||
|
*/
|
||||||
fun getOne(id: Long): RoleWithPowerVo?
|
fun getOne(id: Long): RoleWithPowerVo?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all role in list
|
||||||
|
*
|
||||||
|
* @return List of RoleVo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see RoleVo
|
||||||
|
*/
|
||||||
fun listAll(): List<RoleVo>
|
fun listAll(): List<RoleVo>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add role
|
||||||
|
*
|
||||||
|
* @param roleAddParam Add role parameters
|
||||||
|
* @return RoleVo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see RoleAddParam
|
||||||
|
* @see RoleVo
|
||||||
|
*/
|
||||||
fun add(roleAddParam: RoleAddParam): RoleVo?
|
fun add(roleAddParam: RoleAddParam): RoleVo?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update role
|
||||||
|
*
|
||||||
|
* @param roleUpdateParam Update role parameters
|
||||||
|
* @return RoleVo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see RoleUpdateParam
|
||||||
|
* @see RoleVo
|
||||||
|
*/
|
||||||
fun update(roleUpdateParam: RoleUpdateParam): RoleVo?
|
fun update(roleUpdateParam: RoleUpdateParam): RoleVo?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update status of role
|
||||||
|
*
|
||||||
|
* @param roleUpdateStatusParam Update status of role parameters
|
||||||
|
* @return Result
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see RoleUpdateStatusParam
|
||||||
|
*/
|
||||||
fun status(roleUpdateStatusParam: RoleUpdateStatusParam): Boolean
|
fun status(roleUpdateStatusParam: RoleUpdateStatusParam): Boolean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete role by ID
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
fun deleteOne(id: Long)
|
fun deleteOne(id: Long)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete role by list
|
||||||
|
*
|
||||||
|
* @param roleDeleteParam Delete role parameters
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see RoleDeleteParam
|
||||||
|
*/
|
||||||
fun delete(roleDeleteParam: RoleDeleteParam)
|
fun delete(roleDeleteParam: RoleDeleteParam)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,5 +8,7 @@ import top.fatweb.api.entity.permission.UserGroup
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see IService
|
||||||
|
* @see UserGroup
|
||||||
*/
|
*/
|
||||||
interface IUserGroupService : IService<UserGroup>
|
interface IUserGroupService : IService<UserGroup>
|
||||||
|
|||||||
@@ -8,5 +8,7 @@ import top.fatweb.api.entity.permission.UserInfo
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see IService
|
||||||
|
* @see UserInfo
|
||||||
*/
|
*/
|
||||||
interface IUserInfoService : IService<UserInfo>
|
interface IUserInfoService : IService<UserInfo>
|
||||||
|
|||||||
@@ -8,5 +8,7 @@ import top.fatweb.api.entity.permission.UserRole
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see IService
|
||||||
|
* @see UserRole
|
||||||
*/
|
*/
|
||||||
interface IUserRoleService : IService<UserRole>
|
interface IUserRoleService : IService<UserRole>
|
||||||
|
|||||||
@@ -14,29 +14,135 @@ import top.fatweb.api.vo.permission.UserWithRoleInfoVo
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see IService
|
||||||
|
* @see User
|
||||||
*/
|
*/
|
||||||
interface IUserService : IService<User> {
|
interface IUserService : IService<User> {
|
||||||
|
/**
|
||||||
|
* Get user with power by username
|
||||||
|
*
|
||||||
|
* @param username Username
|
||||||
|
* @return User object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see User
|
||||||
|
*/
|
||||||
fun getUserWithPowerByUsername(username: String): User?
|
fun getUserWithPowerByUsername(username: String): User?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get user information
|
||||||
|
*
|
||||||
|
* @return UserWithPowerInfoVo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see UserWithPowerInfoVo
|
||||||
|
*/
|
||||||
fun getInfo(): UserWithPowerInfoVo?
|
fun getInfo(): UserWithPowerInfoVo?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get user in page
|
||||||
|
*
|
||||||
|
* @param userGetParam Get user parameters
|
||||||
|
* @return PageVo<UserWithRoleInfoVo> object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see UserGetParam
|
||||||
|
* @see PageVo
|
||||||
|
* @see UserWithRoleInfoVo
|
||||||
|
*/
|
||||||
fun getPage(userGetParam: UserGetParam?): PageVo<UserWithRoleInfoVo>
|
fun getPage(userGetParam: UserGetParam?): PageVo<UserWithRoleInfoVo>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get one user by ID
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @return UserWithRoleInfoVo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see UserWithRoleInfoVo
|
||||||
|
*/
|
||||||
fun getOne(id: Long): UserWithRoleInfoVo?
|
fun getOne(id: Long): UserWithRoleInfoVo?
|
||||||
|
|
||||||
fun getList(): List<UserWithInfoVo>
|
/**
|
||||||
|
* Get all user as list
|
||||||
|
*
|
||||||
|
* @return List of UserWithInfoVo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see UserWithInfoVo
|
||||||
|
*/
|
||||||
|
fun listAll(): List<UserWithInfoVo>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add user
|
||||||
|
*
|
||||||
|
* @param userAddParam Add user parameters
|
||||||
|
* @return UserWithPasswordRoleInfoVo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see UserAddParam
|
||||||
|
* @see UserWithPasswordRoleInfoVo
|
||||||
|
*/
|
||||||
fun add(userAddParam: UserAddParam): UserWithPasswordRoleInfoVo?
|
fun add(userAddParam: UserAddParam): UserWithPasswordRoleInfoVo?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update user
|
||||||
|
*
|
||||||
|
* @param userUpdateParam Update user parameters
|
||||||
|
* @return UserWithRoleInfoVo object
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see UserUpdateParam
|
||||||
|
* @see UserWithRoleInfoVo
|
||||||
|
*/
|
||||||
fun update(userUpdateParam: UserUpdateParam): UserWithRoleInfoVo?
|
fun update(userUpdateParam: UserUpdateParam): UserWithRoleInfoVo?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update user password
|
||||||
|
*
|
||||||
|
* @param userUpdatePasswordParam Update user password parameters
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see UserUpdatePasswordParam
|
||||||
|
*/
|
||||||
fun password(userUpdatePasswordParam: UserUpdatePasswordParam)
|
fun password(userUpdatePasswordParam: UserUpdatePasswordParam)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete user by ID
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
fun deleteOne(id: Long)
|
fun deleteOne(id: Long)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete user by list
|
||||||
|
*
|
||||||
|
* @param userDeleteParam Delete user parameters
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
* @see UserDeleteParam
|
||||||
|
*/
|
||||||
fun delete(userDeleteParam: UserDeleteParam)
|
fun delete(userDeleteParam: UserDeleteParam)
|
||||||
|
|
||||||
fun selectIdsWithRoleIds(roleIds: List<Long>): List<Long>
|
/**
|
||||||
|
* Get user IDs list by list of role IDs
|
||||||
|
*
|
||||||
|
* @param roleIds List of role IDs
|
||||||
|
* @return User IDs list
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
fun getIdsWithRoleIds(roleIds: List<Long>): List<Long>
|
||||||
|
|
||||||
fun selectIdsWithGroupIds(groupIds: List<Long>): List<Long>
|
/**
|
||||||
|
* Get user IDs list by list of group IDs
|
||||||
|
*
|
||||||
|
* @param groupIds List of group IDs
|
||||||
|
* @return User IDs list
|
||||||
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
fun getIdsWithGroupIds(groupIds: List<Long>): List<Long>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ import java.time.ZoneOffset
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see AuthenticationManager
|
||||||
|
* @see RedisUtil
|
||||||
|
* @see IUserService
|
||||||
|
* @see IAuthenticationService
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
class AuthenticationServiceImpl(
|
class AuthenticationServiceImpl(
|
||||||
|
|||||||
@@ -11,6 +11,10 @@ import top.fatweb.api.service.permission.IFuncService
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see ServiceImpl
|
||||||
|
* @see FuncMapper
|
||||||
|
* @see Func
|
||||||
|
* @see IFuncService
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
class FuncServiceImpl : ServiceImpl<FuncMapper, Func>(), IFuncService
|
class FuncServiceImpl : ServiceImpl<FuncMapper, Func>(), IFuncService
|
||||||
|
|||||||
@@ -25,6 +25,13 @@ import top.fatweb.api.vo.permission.GroupWithRoleVo
|
|||||||
*
|
*
|
||||||
* @author FatttSnake, fatttsnake@gmail.com
|
* @author FatttSnake, fatttsnake@gmail.com
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
* @see RedisUtil
|
||||||
|
* @see IRoleGroupService
|
||||||
|
* @see IUserService
|
||||||
|
* @see ServiceImpl
|
||||||
|
* @see GroupMapper
|
||||||
|
* @see Group
|
||||||
|
* @see IGroupService
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
class GroupServiceImpl(
|
class GroupServiceImpl(
|
||||||
@@ -140,7 +147,7 @@ class GroupServiceImpl(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun offlineUser(vararg groupIds: Long) {
|
private fun offlineUser(vararg groupIds: Long) {
|
||||||
val userIds = userService.selectIdsWithGroupIds(groupIds.toList())
|
val userIds = userService.getIdsWithGroupIds(groupIds.toList())
|
||||||
WebUtil.offlineUser(redisUtil, *userIds.toLongArray())
|
WebUtil.offlineUser(redisUtil, *userIds.toLongArray())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user