package com.sqx.modules.app.entity;

import cn.hutool.core.date.DateUtil;
import com.amazonaws.services.dynamodbv2.xspec.L;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;

@Data
@AllArgsConstructor
@TableName("user_money_details")
@ApiModel("钱包详情")
public class UserMoneyDetails implements Serializable {
    /**
     * 钱包详情id
     */
    @ApiModelProperty("钱包详情id")
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * 用户id
     */
    @TableField("user_id")
    @ApiModelProperty("用户id")
    private Long userId;

    /**
     * 渠道用户id
     */
    @ApiModelProperty("渠道用户id")
    @TableField("sys_user_id")
    private Long sysUserId;
    @ApiModelProperty("源id")
    private Long sourceId;

    /**
     * 对应用户id
     */
    @TableField("by_user_id")
    @ApiModelProperty("对应用户id")
    private Long byUserId;
    /**
     * 标题
     */
    @ApiModelProperty("标题")
    private String title;

    /***
     * 1 注册 （上级）
     * 2 充值
     * 3 购买
     * 4 提现
     * 5 现金大转盘
     * 6 分享达标
     * 7 任务领取
     * 8 平台操作
     * 9 订单退款
     * 10 渠道推广
     */
    @ApiModelProperty("     * 1 注册 （上级）\n" +
            "     * 2 充值\n" +
            "     * 3 购买\n" +
            "     * 4 提现\n" +
            "     * 5 现金大转盘\n" +
            "     * 6 分享达标\n" +
            "     * 7 任务领取\n" +
            "     * 8 平台操作\n" +
            "     * 9 订单退款\n" +
            "     * 10 渠道推广")
    private Integer classify;
    /**
     * 类别（1充值2支出）
     */
    @ApiModelProperty("类别（1充值2支出）")
    private Integer type;
    /**
     * 状态 1待支付 2已到账 3取消
     */
    @ApiModelProperty("状态 1待支付 2已到账 3取消")
    private Integer state;
    /**
     * 金币
     */
    @ApiModelProperty("金币")
    private BigDecimal money;
    /**
     * 内容
     */
    @ApiModelProperty("内容")
    private String content;

    @ApiModelProperty("金额类型： 1 红包，2金币")
    private Integer moneyType;

    /**
     * 创建时间
     */
    @TableField("create_time")
    @ApiModelProperty("创建时间")
    private String createTime;

    public UserMoneyDetails() {
    }

    /**
     * @param userId    用户Id tb_user的id
     * @param sysUserId 系统用户Id tb_sys_user的id
     * @param byUserId  对应用户Id
     * @param title     标题
     * @param classify 1 注册 （上级）2 充值 3 购买 4 提现 5 现金大转盘 6 分享达标 7 任务领取 8 平台操作 9 订单退款 10 渠道推广
     * @param type      类别（1充值2支出）
     * @param state     状态 1待支付 2已到账 3取消
     * @param money     金额
     * @param content   内容描述
     */
    public UserMoneyDetails(Long userId, Long sysUserId, Long byUserId, String title, Integer classify, Integer type,
                            Integer state, BigDecimal money, String content, Integer moneyType,Long sourceId) {
        this.userId = userId;
        this.sysUserId = sysUserId;
        this.byUserId = byUserId;
        this.title = title;
        this.classify = classify;
        this.type = type;
        this.state = state;
        this.money = money;
        this.content = content;
        this.createTime = DateUtil.now();
        this.moneyType = moneyType;
        this.sourceId = sourceId;
    }

    public UserMoneyDetails(Long userId, Long sysUserId, Long byUserId, String title, Integer classify, Integer type,
                            Integer state, BigDecimal money, String content, Integer moneyType) {
        this.userId = userId;
        this.sysUserId = sysUserId;
        this.byUserId = byUserId;
        this.title = title;
        this.classify = classify;
        this.type = type;
        this.state = state;
        this.money = money;
        this.content = content;
        this.createTime = DateUtil.now();
        this.moneyType = moneyType;
    }
}
