package com.yuchen.saas.parking.api.enums;

import lombok.AllArgsConstructor;

/**
 * @Author
 * @Date 2023/5/25 15:56
 * @Description 优惠充值类型枚举信息
 */
@AllArgsConstructor
public enum CouponRechargeTypeEnum {

    ADMIN(1, "后台充值"),

    USER(2, "用户充值"),
    ;

    private Integer code;

    public Integer getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    private String description;

    public static String getDescByCode(Integer code) {
        CouponRechargeTypeEnum[] enumArray = CouponRechargeTypeEnum.values();
        for (CouponRechargeTypeEnum e : enumArray) {
            if (e.getCode().equals(code)) {
                return e.getDescription();
            }
        }
        return "";
    }
}
