package com.red.circle.other.domain.redpacket;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 房间红包来源类型
 */
@Getter
@AllArgsConstructor
public enum RoomRedPacketSourceType {

    /**
     * 用户红包
     */
    USER(1, "User Red Packet"),

    /**
     * 平台红包
     */
    PLATFORM(2, "Platform Red Packet");

    private final Integer code;
    private final String desc;

    public static RoomRedPacketSourceType of(Integer code) {
        for (RoomRedPacketSourceType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
}
