package com.hfkj.sysenum.order;

import lombok.Data;
import lombok.Getter;

import java.util.Objects;

/**
 * @className: OrderChildStatusEnum
 * @author: HuRui
 * @date: 2024/5/6
 **/
@Getter
public enum OrderChildStatusEnum {
    /**
     * 待支付
     */
    status1(1, "待支付"),

    /**
     * 已支付
     */
    status2(2, "已支付"),

    /**
     * 已完成
     */
    status3(3, "已完成"),

    /**
     * 已退款
     */
    status4(4, "已退款"),

    /**
     * 已取消
     */
    status5(5, "已取消"),

    /**
     * 退款中
     */
    status6(6, "退款中"),
    ;

    private final int code;

    private final String name;


    OrderChildStatusEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static OrderChildStatusEnum getData(Integer type) {
        for (OrderChildStatusEnum ele : values()) {
            if (Objects.equals(type,ele.getCode())) return ele;
        }
        return null;
    }
}
