package com.red.circle.console.app.dto.cmd.admin;

import com.red.circle.framework.core.dto.CommonCommand;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 用户.
 * </p>
 *
 * @author pengliang
 * @Email(groups = {Create.class, Update.class}, message = "邮箱格式不正确")
 * @Pattern(groups = {Create.class, Update.class}, regexp = Regex.PHONE, message = "手机号码格式不正确")
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
public class UserCmd extends CommonCommand {

  private static final long serialVersionUID = 1L;

  /**
   * 用户id.
   */
  @NotNull(groups = {Update.class, Status.class}, message = "用户名ID不可为空")
  private Integer id;

  /**
   * 登陆名.
   */
  @NotBlank(groups = {Create.class, Update.class}, message = "用户名不能为空")
  private String loginName;

  /**
   * 昵称.
   */
  @NotBlank(groups = {Create.class, Update.class}, message = "昵称不能为空")
  private String nickname;

  /**
   * 邮箱.
   */
  private String email;

  /**
   * 手机号.
   */
  private String phone;

  /**
   * 状态:0：禁用 1：正常.
   */
  @NotNull(groups = Status.class, message = "用户状态不能为空")
  private Integer status;

  /**
   * 用户角色ID.
   */
  @NotEmpty(groups = {Create.class, Update.class}, message = "用户角色不能为空")
  private List<Integer> roleIds;

  public interface Create {

  }

  public interface Update {

  }

  public interface Status {

  }

}
