package org.springblade.common.enums;

import lombok.Getter;

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

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

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