Complete core functions #9
@@ -46,7 +46,7 @@ object GroupConverter {
|
||||
|
||||
fun groupAddParamToGroup(groupAddParam: GroupAddParam) = Group().apply {
|
||||
name = groupAddParam.name
|
||||
enable = if (groupAddParam.enable == true) 1 else 0
|
||||
enable = if (groupAddParam.enable) 1 else 0
|
||||
roles = groupAddParam.roleIds?.map { Role().apply { id = it } }
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ data class GroupAddParam(
|
||||
@field:NotBlank(message = "Name can not be blank")
|
||||
val name: String?,
|
||||
|
||||
@Schema(description = "启用", allowableValues = ["true", "false"])
|
||||
val enable: Boolean? = true,
|
||||
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
||||
val enable: Boolean = true,
|
||||
|
||||
@Schema(description = "角色 ID 列表")
|
||||
val roleIds: List<Long>? = null
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package top.fatweb.api.param.permission.group
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema
|
||||
import jakarta.validation.constraints.Min
|
||||
import jakarta.validation.constraints.NotNull
|
||||
|
||||
/**
|
||||
@@ -13,10 +12,9 @@ import jakarta.validation.constraints.NotNull
|
||||
@Schema(description = "用户组更改状态请求参数")
|
||||
data class GroupChangeStatusParam(
|
||||
@Schema(description = "用户组 ID")
|
||||
@field:Min(0)
|
||||
val id: Long,
|
||||
@field:NotNull(message = "ID can not be null")
|
||||
val id: Long?,
|
||||
|
||||
@Schema(description = "启用", allowableValues = ["true", "false"])
|
||||
@field:NotNull
|
||||
val enable: Boolean
|
||||
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
||||
val enable: Boolean = true
|
||||
)
|
||||
@@ -14,6 +14,6 @@ data class GroupGetParam(
|
||||
@Schema(description = "查询用户组名称")
|
||||
val searchName: String? = null,
|
||||
|
||||
@Schema(description = "查询使用正则表达式", allowableValues = ["true", "false"])
|
||||
@Schema(description = "查询使用正则表达式", allowableValues = ["true", "false"], defaultValue = "false")
|
||||
val searchRegex: Boolean = false,
|
||||
) : PageSortParam()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package top.fatweb.api.param.permission.group
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema
|
||||
import jakarta.validation.constraints.Min
|
||||
import jakarta.validation.constraints.NotBlank
|
||||
import jakarta.validation.constraints.NotNull
|
||||
|
||||
/**
|
||||
* Group update param
|
||||
@@ -13,15 +13,15 @@ import jakarta.validation.constraints.NotBlank
|
||||
@Schema(description = "用户组更新请求参数")
|
||||
data class GroupUpdateParam(
|
||||
@Schema(description = "用户组 ID")
|
||||
@field:Min(0)
|
||||
@field:NotNull(message = "ID can not be null")
|
||||
val id: Long,
|
||||
|
||||
@Schema(description = "用户组名称")
|
||||
@field:NotBlank(message = "Name can not be blank")
|
||||
val name: String?,
|
||||
|
||||
@Schema(description = "启用", allowableValues = ["true", "false"])
|
||||
val enable: Boolean? = true,
|
||||
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
||||
val enable: Boolean = true,
|
||||
|
||||
@Schema(description = "角色 ID 列表")
|
||||
val roleIds: List<Long>? = null
|
||||
|
||||
@@ -15,8 +15,8 @@ data class RoleAddParam(
|
||||
@field:NotBlank(message = "Name can not be blank")
|
||||
val name: String?,
|
||||
|
||||
@Schema(description = "启用", allowableValues = ["true", "false"])
|
||||
val enable: Boolean? = true,
|
||||
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
||||
val enable: Boolean = true,
|
||||
|
||||
@Schema(description = "权限 ID 列表")
|
||||
val powerIds: List<Long>? = null
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package top.fatweb.api.param.permission.role
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema
|
||||
import jakarta.validation.constraints.Min
|
||||
import jakarta.validation.constraints.NotNull
|
||||
|
||||
/**
|
||||
@@ -13,10 +12,9 @@ import jakarta.validation.constraints.NotNull
|
||||
@Schema(description = "角色更改状态请求参数")
|
||||
data class RoleChangeStatusParam(
|
||||
@Schema(description = "角色 ID")
|
||||
@field:Min(0)
|
||||
@field:NotNull(message = "Role id can not be null")
|
||||
val id: Long,
|
||||
|
||||
@Schema(description = "启用", allowableValues = ["true", "false"])
|
||||
@field:NotNull
|
||||
val enable: Boolean
|
||||
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
||||
val enable: Boolean = true
|
||||
)
|
||||
@@ -14,6 +14,6 @@ data class RoleGetParam(
|
||||
@Schema(description = "查询角色名称")
|
||||
val searchName: String? = null,
|
||||
|
||||
@Schema(description = "查询使用正则表达式", allowableValues = ["true", "false"])
|
||||
@Schema(description = "查询使用正则表达式", allowableValues = ["true", "false"], defaultValue = "false")
|
||||
val searchRegex: Boolean = false,
|
||||
) : PageSortParam()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package top.fatweb.api.param.permission.role
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema
|
||||
import jakarta.validation.constraints.Min
|
||||
import jakarta.validation.constraints.NotBlank
|
||||
import jakarta.validation.constraints.NotNull
|
||||
|
||||
/**
|
||||
* Role update param
|
||||
@@ -13,15 +13,15 @@ import jakarta.validation.constraints.NotBlank
|
||||
@Schema(description = "角色更新请求参数")
|
||||
data class RoleUpdateParam(
|
||||
@Schema(description = "角色 ID")
|
||||
@field:Min(0)
|
||||
@field:NotNull(message = "Role id can not be null")
|
||||
val id: Long,
|
||||
|
||||
@Schema(description = "角色名称")
|
||||
@field:NotBlank(message = "Name can not be blank")
|
||||
val name: String?,
|
||||
|
||||
@Schema(description = "启用", allowableValues = ["true", "false"])
|
||||
val enable: Boolean? = true,
|
||||
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
||||
val enable: Boolean = true,
|
||||
|
||||
@Schema(description = "权限 ID 列表")
|
||||
val powerIds: List<Long>? = null
|
||||
|
||||
@@ -13,7 +13,7 @@ data class UserAddParam(
|
||||
@Schema(description = "密码(为空自动生成随机密码)")
|
||||
val password: String?,
|
||||
|
||||
@Schema(description = "锁定")
|
||||
@Schema(description = "锁定", allowableValues = ["true", "false"], defaultValue = "false")
|
||||
val locking: Boolean = false,
|
||||
|
||||
@Schema(description = "过期时间")
|
||||
@@ -22,7 +22,7 @@ data class UserAddParam(
|
||||
@Schema(description = "认证过期时间")
|
||||
val credentialsExpiration: LocalDateTime?,
|
||||
|
||||
@Schema(description = "启用")
|
||||
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
||||
val enable: Boolean = true,
|
||||
|
||||
@Schema(description = "昵称")
|
||||
|
||||
@@ -14,6 +14,6 @@ data class UserGetParam(
|
||||
@Schema(description = "查询内容")
|
||||
val searchValue: String? = null,
|
||||
|
||||
@Schema(description = "查询使用正则表达式", allowableValues = ["true", "false"])
|
||||
@Schema(description = "查询使用正则表达式", allowableValues = ["true", "false"], defaultValue = "false")
|
||||
val searchRegex: Boolean = false,
|
||||
) : PageSortParam()
|
||||
|
||||
@@ -13,7 +13,7 @@ data class UserUpdateParam(
|
||||
@Schema(description = "用户名")
|
||||
val username: String?,
|
||||
|
||||
@Schema(description = "锁定")
|
||||
@Schema(description = "锁定", allowableValues = ["true", "false"], defaultValue = "false")
|
||||
val locking: Boolean = false,
|
||||
|
||||
@Schema(description = "过期时间")
|
||||
@@ -22,7 +22,7 @@ data class UserUpdateParam(
|
||||
@Schema(description = "认证过期时间")
|
||||
val credentialsExpiration: LocalDateTime?,
|
||||
|
||||
@Schema(description = "启用")
|
||||
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
|
||||
val enable: Boolean = true,
|
||||
|
||||
@Schema(description = "昵称")
|
||||
|
||||
@@ -26,7 +26,7 @@ data class SysLogGetParam(
|
||||
@Schema(description = "查询请求 Url")
|
||||
val searchRequestUrl: String? = null,
|
||||
|
||||
@Schema(description = "查询使用正则表达式")
|
||||
@Schema(description = "查询使用正则表达式", allowableValues = ["true", "false"], defaultValue = "false")
|
||||
val searchRegex: Boolean = false,
|
||||
|
||||
@Schema(description = "查询开始时间")
|
||||
|
||||
Reference in New Issue
Block a user