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_member_and_service")
public class MemberAndService implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", columnDefinition = "int COMMENT '主键'")
    private Integer id;

    @Column(name = "title", columnDefinition = "varchar(30) COMMENT '标题'")
    @ApiModelProperty(value = "标题")
    private String title;

    @Column(name = "content", columnDefinition = "text COMMENT '套餐描述'")
    @ApiModelProperty(value = "套餐描述")
    private String content;

    @Column(name = "free_title", columnDefinition = "varchar(30) COMMENT '免费版标题'")
    @ApiModelProperty(value = "免费版标题")
    private String freeTitle;

    @Column(name = "free_content", columnDefinition = "text COMMENT '免费版套餐描述'")
    @ApiModelProperty(value = "免费版套餐描述")
    private String freeContent;

    @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;

    @Column(name = "modify_time")
    @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;

}
