package com.bizzan.bitrade.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 法币表
 */
@Entity
@Data
@Table(name = "currency_coin")
public class CurrencyCoin {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /** 法币名称，如 CNY、USD */
    private String currency;

    /** 法币符号，如 ¥、$ */
    private String symbol;

    /** 当前 USDT 汇率 */
    private BigDecimal rate;

    /** 精度（小数位数） */
    private Integer coinPrecision;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "ctime", updatable = false)
    private Date ctime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "mtime")
    private Date mtime;
}
