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.math.BigDecimal;
import java.util.Date;

/**
 * 反馈意见
 */
@Data
@Entity
@Table(name = "tb_opinion")
public class Opinion implements Serializable {

    private static final long serialVersionUID = 1L;

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

    @Column(name = "phone", columnDefinition = "varchar(30) COMMENT '电话号码'")
    @ApiModelProperty(value = "电话号码")
    private String phone;

    @Column(name = "qq", columnDefinition = "varchar(30) COMMENT 'qq号码'")
    @ApiModelProperty(value = "qq号码")
    private String qq;

    @Column(name = "wechat", columnDefinition = "varchar(50) COMMENT '微信账号'")
    @ApiModelProperty(value = "微信账号")
    private String wechat;

    @Column(name = "email", columnDefinition = "varchar(50) COMMENT '邮箱地址'")
    @ApiModelProperty(value = "邮箱地址")
    private String email;

    @Column(name = "content", columnDefinition = "text COMMENT '反馈意见内容'")
    @ApiModelProperty(value = "反馈意见内容")
    private String content;

    @Column(name = "uid")
    @ApiModelProperty(value = "用户登录ID")
    private String uid;

    @Transient
    @ApiModelProperty(value = "创建者姓名")
    private String userName;

    @Column(name = "isDelete", columnDefinition = "int COMMENT '是否已删除'")
    @ApiModelProperty(value = "是否是删除状态(0:否；1:是)")
    private Integer isDelete = 0;

    @Column(name = "is_processed", columnDefinition = "int COMMENT '是否已处理'")
    @ApiModelProperty(value = "是否已处理(0:否；1:是)")
    private Integer isProcessed = 0;

    @Column(name = "create_time", columnDefinition = "datetime COMMENT '创建时间'")
    @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;

    @Column(name = "modify_time", columnDefinition = "datetime COMMENT '更新时间'")
    @ApiModelProperty(value = "更新时间")
    @org.hibernate.annotations.UpdateTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = DateSerializer.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")//json序列化实体类处理
    private Date modifyTime;

    @Column(name = "onlyID")
    @ApiModelProperty(value = "onlyID")
    private String onlyID;
}
