package com.ruoyi.user.domain.bo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 小程序用户管理业务对象 tb_user
 *
 * @author wuchao
 * @date 2022-03-03
 */

@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("小程序用户管理业务对象")
public class UserBo extends BaseEntity {

    /**
     * id
     */
    @ApiModelProperty(value = "id", required = true)
    @NotNull(message = "id不能为空", groups = { EditGroup.class })
    private Long id;

    /**
     * 业务id
     */
    private String businessId;

    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号", required = true)
    @NotBlank(message = "手机号不能为空", groups = { AddGroup.class, EditGroup.class })
    private String mobile;

    /**
     * 昵称
     */
    @ApiModelProperty(value = "昵称", required = true)
    @NotBlank(message = "昵称不能为空", groups = { AddGroup.class, EditGroup.class })
    private String nickname;

    /**
     * 头像
     */
    @ApiModelProperty(value = "头像", required = true)
    @NotBlank(message = "头像不能为空", groups = { AddGroup.class, EditGroup.class })
    private String headPhoto;

    /**
     * 年龄
     */
    @ApiModelProperty(value = "年龄", required = true)
    @NotNull(message = "年龄不能为空", groups = { AddGroup.class, EditGroup.class })
    private Long age;

    /**
     * 性别 0：未知、 1：男、 2：女
     */
    @ApiModelProperty(value = "性别 * 0：未知、 * 1：男、 * 2：女", required = true)
    @NotNull(message = "性别不能为空", groups = { AddGroup.class, EditGroup.class })
    private Integer gender;

    /**
     * 真实姓名
     */
    @ApiModelProperty(value = "真实姓名", required = true)
    @NotBlank(message = "真实姓名不能为空", groups = { AddGroup.class, EditGroup.class })
    private String realName;

    /**
     * 生日
     */
    @ApiModelProperty(value = "生日", required = true)
    @NotBlank(message = "生日不能为空", groups = { AddGroup.class, EditGroup.class })
    private String birthday;

    /**
     * 状态（0：禁用，1：启用）
     */
    @ApiModelProperty(value = "状态（0：禁用，1：启用）", required = true)
    @NotNull(message = "状态不能为空", groups = { AddGroup.class, EditGroup.class })
    private Boolean status;

    /**
     * 最后一次登录时间
     */
    @ApiModelProperty(value = "最后一次登录时间", required = true)
    @NotNull(message = "最后一次登录时间不能为空", groups = { AddGroup.class, EditGroup.class })
    private Date lastLoginTime;

    /**
     * 订单数
     */
    @ApiModelProperty(value = "订单数", required = true)
    private Integer orderNum;

    /** 查询用 **/
    /**
     * 创建时间开始
     */
    @ApiModelProperty(value = "注册日期开始")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createDayStart;

    /**
     * 注册日期
     */
    @ApiModelProperty(value = "注册日期结束")
    @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date createDayEnd;
}
