package org.springblade.common.enums;

import lombok.Getter;

/**
 * 订单类型枚举类
 */
@Getter
public enum PaymentStateEnum {
	UN_PAID("未支付", 1),
	PAID("已支付", 2),
	REFUNDED("已退款",3);
	private String name;
	private Integer value;

	PaymentStateEnum(String name, Integer value) {
		this.name = name;
		this.value = value;
	}

	public static String getNameByValue(Integer value) {
		for (PaymentStateEnum orderTypeEnum : PaymentStateEnum.values()) {
			if (orderTypeEnum.value.equals(value)) {
				return orderTypeEnum.getName();
			}
		}
		return "未知";
	}
}
