package com.taais.common.core.core.domain.model;

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

import static com.taais.common.core.constant.UserConstants.PASSWORD_MAX_LENGTH;
import static com.taais.common.core.constant.UserConstants.PASSWORD_MIN_LENGTH;
import static com.taais.common.core.constant.UserConstants.USERNAME_MAX_LENGTH;
import static com.taais.common.core.constant.UserConstants.USERNAME_MIN_LENGTH;

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

    /**
     * 用户名
     */
    @NotBlank(message = "{user.username.not.blank}")
    @Length(min = USERNAME_MIN_LENGTH, max = USERNAME_MAX_LENGTH, message = "{user.username.length.valid}")
    private String username;

    /**
     * 用户密码
     */
    @NotBlank(message = "{user.password.not.blank}")
    @Length(min = PASSWORD_MIN_LENGTH, max = PASSWORD_MAX_LENGTH, message = "{user.password.length.valid}")
    private String password;

}
