package com.jwipc.order.constant;

import lombok.Getter;

/**
 * <p> </p>
 *
 * @author ZhangJie
 * @version 1.0
 * @since JDK 1.8
 */
@Getter
public enum AppointmentStatus {
    //预约状态
    /**
     * 0.预约中
     * 1.已预约
     */
    APPOINTMENT_STATUS_0(0, "预约中"),
    APPOINTMENT_STATUS_1(1, "已预约");
    private int code;
    private String message;

    AppointmentStatus(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public static AppointmentStatus getByCode(Integer code) {
        for (AppointmentStatus appointmentStatus : values()) {
            if (appointmentStatus.getCode() == code) {
                return appointmentStatus;
            }
        }
        throw new IllegalArgumentException("没有找到对应的枚举");
    }
}
