package com.sqx.modules.discSpinning.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 大转盘抽奖记录(DiscSpinningRecord)表实体类
 *
 * @author ww
 * @since 2024-12-04 11:37:36
 */
@Data
@TableName("disc_spinning_record")
public class DiscSpinningRecord extends Model<DiscSpinningRecord> {
    //主键
    private Long id;

    private Long sourceId;

    private Long userId;
    private String imgUrl;
    //描述
    private String name;
    //类型 1谢谢惠顾 2 红包 9 其它
    private Integer type;
    //金额
    private BigDecimal number;
    //流向  1 提现 2 存入余额 3 兑换
    private String target;

    private Long targetId;
    //抽奖日期
    private String drawDay;
    //创建时间
    private String createTime;
    //来源 task 任务  order 订单
    private String source = "order";

    public DiscSpinningRecord() {
    }

    public DiscSpinningRecord(String name, Long sourceId, Long userId,String imgUrl, Integer type, BigDecimal number,
                              String drawDay, String createTime, Integer source) {
        this.name = name;
        this.userId = userId;
        this.sourceId = sourceId;
        this.imgUrl = imgUrl;
        this.type = type;
        this.number = number;
        this.drawDay = drawDay;
        this.createTime = createTime;
        if (source != null) {
            switch (source) {
                case 1:
                    this.source = "order";
                    break;
                case 2:
                    this.source = "taskW";
                    break;
                case 3:
                    this.source = "taskM";
                    break;
                default:
                    this.source = source.toString();
            }
        }
    }
}

