package shop.alien.entity.store;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 短信验证码记录
 */
@Data
@TableName("store_verification_code")
public class StoreVerificationCode extends Model<StoreVerificationCode> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("业务类型 (0:登录,1:修改密码,2:注册,3:修改手机号,4:注销店铺,5:注销账号,6:忘记密码)")
    @TableField("business_type")
    private Integer businessType;

    @ApiModelProperty("手机号")
    @TableField("phone")
    private String phone;

    @ApiModelProperty("端区分(0:用户,1:商家,2:律师端)")
    @TableField("app_type")
    private Integer appType;

    @ApiModelProperty("验证码")
    @TableField("code")
    private String code;

    @ApiModelProperty("创建时间")
    @TableField("created_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;

    @ApiModelProperty("更新时间")
    @TableField("updated_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedTime;

    @ApiModelProperty("创建人ID")
    @TableField("created_user_id")
    private Integer createdUserId;

    @ApiModelProperty("更新人ID")
    @TableField("updated_user_id")
    private Integer updatedUserId;

    @ApiModelProperty("删除标志(0:正常,1:删除)")
    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}

