Add two-factor api
This commit is contained in:
@@ -34,5 +34,14 @@ data class LoginParam(
|
||||
*/
|
||||
@Schema(description = "密码", required = true)
|
||||
@field:NotBlank(message = "Password can not be blank")
|
||||
val password: String?
|
||||
val password: String?,
|
||||
|
||||
/**
|
||||
* Two-factor code
|
||||
*
|
||||
* @author FatttSnake, fatttsnake@gmail.com
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Schema(description = "二步验证码")
|
||||
val twoFactorCode: String?
|
||||
) : CaptchaCodeParam()
|
||||
@@ -0,0 +1,23 @@
|
||||
package top.fatweb.oxygen.api.param.permission
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema
|
||||
import jakarta.validation.constraints.NotBlank
|
||||
|
||||
/**
|
||||
* Validate two-factor parameters
|
||||
*
|
||||
* @author FatttSnake, fatttsnake@gmail.com
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Schema(description = "验证二步验证请求参数")
|
||||
data class TwoFactorValidateParam(
|
||||
/**
|
||||
* Code
|
||||
*
|
||||
* @author FatttSnake, fatttsnake@gmail.com
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Schema(description = "验证码")
|
||||
@field:NotBlank(message = "Code can not be blank")
|
||||
val code: String?
|
||||
)
|
||||
@@ -0,0 +1,37 @@
|
||||
package top.fatweb.oxygen.api.param.system
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema
|
||||
import jakarta.validation.constraints.Min
|
||||
import jakarta.validation.constraints.NotNull
|
||||
import top.fatweb.oxygen.api.annotation.Trim
|
||||
|
||||
/**
|
||||
* Two-factor settings parameters
|
||||
*
|
||||
* @author FatttSnake, fatttsnake@gmail.com
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Trim
|
||||
@Schema(description = "二步验证设置请求参数")
|
||||
data class TwoFactorSettingsParam(
|
||||
/**
|
||||
* Issuer
|
||||
*
|
||||
* @author FatttSnake, fatttsnake@gmail.com
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Trim
|
||||
@Schema(description = "发布者")
|
||||
var issuer: String?,
|
||||
|
||||
/**
|
||||
* Length of secret key
|
||||
*
|
||||
* @author FatttSnake, fatttsnake@gmail.com
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Schema(description = "密钥长度")
|
||||
@field:NotNull(message = "Length of secret key can not be null")
|
||||
@field:Min(value = 3, message = "The length of the key must be greater than or equal to 3")
|
||||
val secretKeyLength: Int?
|
||||
)
|
||||
Reference in New Issue
Block a user