package com.yonge.cooleshow.biz.dal.enums.album;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.yonge.toolset.base.enums.BaseEnum;

/**
 * 单曲、专辑付费购买类型
 */
public enum PurchaseRecordTypeEnum implements BaseEnum<String, PurchaseRecordTypeEnum> {

    MUSIC("曲目"),
    ALBUM("专辑"),
    ;
    @EnumValue
    private String code;
    private String msg;

    PurchaseRecordTypeEnum(String msg) {
        this.code = this.name();
        this.msg = msg;
    }

    public String getMsg() {
        return this.msg;
    }

    @Override
    public String getCode() {
        return this.code;
    }

    /**
     * 收费类型匹配
     * @param type 收费类型
     * @return boolean
     */
    public boolean match(String type) {

        return getCode().equals(type);
    }
}
