package com.bizzan.bitrade.entity;

import com.bizzan.bitrade.constant.MemberOperationType;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;

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

/**
 * 用户操作记录
 */
@Entity
@Data
@Table(name = "member_operation_log")
public class MemberOperationLog {

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

    private Long memberId;

    @Enumerated(EnumType.STRING)
    private MemberOperationType operationType;

    private String ip;

    private Integer deviceType;

    private String remark;

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