package org.springblade.common.enums;

import lombok.Getter;

/**
 * 支付标识枚举类
 */
@Getter
public enum PayFlagEnum {
	WAIT_PAY("待付款", 1),
	WAIT_DELIVERY("待发货", 2),
	WAIT_RECEIVE("待收货", 3),
	COMPLETED("已完成", 4),
	CANCEL("已取消", 5),
	REFUNDING("退款中", 6),
	REFUNDED("已退款", 7);
	private String name;
	private Integer value;

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

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