部门代码优化

This commit is contained in:
none
2023-02-25 11:18:09 +08:00
parent bfa1040a54
commit 5672c70ccb
7 changed files with 69 additions and 83 deletions

View File

@@ -1,6 +1,7 @@
package xyz.playedu.api.request.backend;
import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
@@ -17,15 +18,16 @@ public class DepartmentRequest implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
@NotNull(message = "请输入部门名称")
@NotBlank(message = "请输入部门名称")
@NotNull(message = "name参数不存在")
@Length(min = 1, max = 20, message = "部门名称长度在1-20个字符之间")
private String name;
@JsonProperty("parent_id")
@NotNull(message = "请选择上级部门")
@NotNull(message = "parent_id参数不存在")
private Integer parentId;
@NotNull(message = "请输入排序值")
@NotNull(message = "sort参数不存在")
private Integer sort;
}