package com.ff.weijinxiao.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ff.weijinxiao.util.jsonfilter.DateSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 短信发送流水
 */
@Data
@Entity
@Table(name = "tb_sms_record")
public class SmsJour implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Integer id;

    @Column(name = "phone")
    @ApiModelProperty(value = "手机号码")
    private String phone;

    @Column(name = "sms_code")
    @ApiModelProperty(value = "验证码")
    private String smsCode;

    @Column(name = "is_valid")
    @ApiModelProperty(value = "是否有效 1-有效 0-无效")
    private Integer isValid;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    @org.hibernate.annotations.CreationTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")//json序列化实体类处理
    private Date createTime;

}
