package com.fzm.mall.server.admin.finance_center.model;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author wangp
 * @date 2021/3/4 16:06
 * @description 用户资产变更记录表
 * @since JDK 1.8
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("user_asset_record")
@ApiModel(value = "UserAssetRecord对象", description = "用户资产变更记录表")
public class UserAssetRecord implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "用户资产变更表自增id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "流水号")
    private String flowId;

    @ApiModelProperty(value = "用户uid")
    private String uid;

    @ApiModelProperty(value = "变更资产名称（如:btc、金币）")
    private String coin;

    @ApiModelProperty(value = "变更行为(如:0、默认值 1、提现 2、提币 3、转账)")
    private Integer type;

    @ApiModelProperty(value = "变更资产金额")
    private BigDecimal amount;

    @ApiModelProperty(value = "流水状态（1.失败 2.成功）")
    private Integer status;

    @ApiModelProperty(value = "资产来源(如果是RMB资产，则对方为用户编号，如果是数字资产，则为对方的数字货币地址；如果是平台，则用“平台”即可)")
    private String otherSide;

    @ApiModelProperty(value = "信息入库时间")
    @TableField(fill = FieldFill.INSERT)
    private Long createTime;

    @ApiModelProperty(value = "信息更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateTime;

    @ApiModelProperty(value = "转账hash")
    private String hash;

    @ApiModelProperty(value = "备注")
    private String note;

    public UserAssetRecord() {
    }

    public UserAssetRecord(String flowId, String uid, String coin, Integer type, BigDecimal amount, Integer status, String otherSide) {
        this.flowId = flowId;
        this.uid = uid;
        this.coin = coin;
        this.type = type;
        this.amount = amount;
        this.status = status;
        this.otherSide = otherSide;
    }
}
