package com.ssyf.module.auth.domain.query;

import com.ssyf.common.web.valid.ValidA;
import com.ssyf.common.web.valid.ValidB;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
* @author: auth
* @date: 2022-10-30
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class AccountQuery implements Serializable {

    /**
     * 邮箱
     */
    @NotNull(message = "{user.mail.notnull}" ,groups = {ValidB.class})
    private String mail;
    /**
     * 用户名称
     */
    @Length(min = 5 ,max = 32 ,message = "{user.username.length}" ,groups = {ValidA.class})
    @NotNull(message = "{notnull}",groups = {ValidA.class })
    private String username;

    /**
     * 密码
     */
    @Length(min = 5 ,max = 20 ,message = "{user.password.length}" ,groups = {ValidA.class ,ValidB.class})
    @NotNull(message = "{notnull}",groups = {ValidA.class ,ValidB.class})
    private String password;

}
