Add sensitive word filter

This commit is contained in:
2024-01-04 17:55:41 +08:00
parent f3b63ce17d
commit 3b9111392e
21 changed files with 466 additions and 9 deletions

View File

@@ -54,7 +54,7 @@ open class AvatarBaseParam {
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
@Schema(defaultValue = "颜色列表", example = "#FFFFFFAA")
@Schema(description = "颜色列表", example = "#FFFFFFAA")
var colors: List<String>? = null
/**
@@ -63,7 +63,7 @@ open class AvatarBaseParam {
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
@Schema(defaultValue = "背景颜色", example = "#FFFFFFAA")
@Schema(description = "背景颜色", example = "#FFFFFFAA")
@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
}

View File

@@ -10,6 +10,7 @@ import io.swagger.v3.oas.annotations.media.Schema
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
@Schema(description = "用户活跃信息请求参数")
data class ActiveInfoGetParam(
/**
* Scope

View File

@@ -10,6 +10,7 @@ import io.swagger.v3.oas.annotations.media.Schema
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
@Schema(description = "在线信息请求参数")
data class OnlineInfoGetParam(
/**
* Scope

View File

@@ -0,0 +1,43 @@
package top.fatweb.oxygen.api.param.system
import io.swagger.v3.oas.annotations.media.Schema
import jakarta.validation.constraints.NotBlank
import top.fatweb.oxygen.api.entity.system.SensitiveWord
/**
* Add sensitive word settings parameters
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
@Schema(defaultValue = "敏感词添加请求参数")
data class SensitiveWordAddParam(
/**
* Word
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
@Schema(description = "", required = true)
@field:NotBlank(message = "Word can not be blank")
val word: String?,
/**
* Use for
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
* @see SensitiveWord.Use
*/
@Schema(description = "用于", allowableValues = ["USERNAME"])
val useFor: Set<SensitiveWord.Use> = emptySet(),
/**
* Enable
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
@Schema(description = "启用", allowableValues = ["true", "false"], defaultValue = "true")
val enable: Boolean = true
)

View File

@@ -0,0 +1,15 @@
package top.fatweb.oxygen.api.param.system
import io.swagger.v3.oas.annotations.media.Schema
/**
* Update sensitive word settings parameters
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
@Schema(defaultValue = "敏感词修改请求参数")
data class SensitiveWordUpdateParam(
@Schema(description = "ID 列表")
val ids: Set<Long> = emptySet()
)