package org.dromara.common.core.domain.model;

import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

/**
 * 密码登录对象
 *
 * @author shihongwei
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class PasswordLoginBody extends LoginBody {

    /**
     * 账号（手机号、用户名等）
     */
    @NotBlank(message = "{user.account.not.blank}")
    @Length(min = 2, max = 30, message = "{user.username.length.valid}")
    private String account;

    /**
     * 用户密码
     */
    @NotBlank(message = "{user.password.not.blank}")
    @Length(min = 5, max = 30, message = "{user.password.length.valid}")
//    @Pattern(regexp = RegexConstants.PASSWORD, message = "{user.password.format.valid}")
    private String password;

    /**
     * 企业用户角色ID，在存在多企业角色时使用
     */
    private Long companyRoleId;

    /**
     * 登录端口
     */
    private String loginPort;
}
