package cn.reghao.bnt.web.admin.model.dto;

import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

import java.util.Set;

/**
 * @author reghao
 * @date 2023-10-23 17:38:19
 */
@Setter
@Getter
public class CreateAccountDto {
    @NotNull(message = "帐号不能为 null")
    @Length(min = 6, max = 10, message = "帐号长度在 6 ~ 10 个字符")
    private String username;
    @NotNull(message = "密码不能为 null")
    @Length(min = 8, max = 16, message = "密码长度在 8 ~ 16 个字符")
    private String password;
    @Size(min = 1, max = 10, message = "用户角色数量为 1~10")
    private Set<String> roles;

    public CreateAccountDto(String username, String password) {
        this.username = username;
        this.password = password;
    }
}
