Optimize ToolBase and ToolTemplate api

This commit is contained in:
2024-01-22 18:18:47 +08:00
parent 3da5260ddd
commit 98e2f637d2
13 changed files with 29 additions and 135 deletions

View File

@@ -2,24 +2,15 @@ package top.fatweb.oxygen.api.param.tool
import jakarta.validation.constraints.NotBlank
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Pattern
data class ToolTemplateAddParam(
@field: NotBlank(message = "Name can not be blank")
val name: String?,
@field: NotBlank(message = "Ver can not be blank")
@field: Pattern(regexp = "^\\d+\\.\\d+\\.\\d+\$", message = "Ver can only match '<number>.<number>.<number>'")
val ver: String?,
@field: NotNull(message = "BaseId can not be null")
val baseId: Long? = null,
@field: NotNull(message = "Source can not be null")
val source: String?,
@field:NotNull(message = "Dist can not be null")
val dist: String?,
val source: String = "",
val enable: Boolean = true
)

View File

@@ -1,7 +1,6 @@
package top.fatweb.oxygen.api.param.tool
import jakarta.validation.constraints.NotNull
import jakarta.validation.constraints.Pattern
data class ToolTemplateUpdateParam(
@field: NotNull(message = "ID can not be null")
@@ -9,14 +8,9 @@ data class ToolTemplateUpdateParam(
val name: String?,
@field: Pattern(regexp = "^\\d+\\.\\d+\\.\\d+\$", message = "Ver can only match '<number>.<number>.<number>'")
val ver: String?,
val baseId: Long?,
val source: String?,
val dist: String?,
val enable: Boolean?
)