package com.ruoyi.common.enums;

import lombok.Getter;

/**
 * @Author Tang, Shuai(shuatang @ deloitte.com.cn)
 * @Date 2024/12/23 22:15
 */
@Getter
public enum ServiceTimeSlotEnum {

    MORNING("MORNING", "08:00-12:00"),
    AFTERNOON("AFTERNOON", "12:00-18:00"),
    EVENING("EVENING", "18:00-22:00");

    private final String label;
    private final String desc;

    private ServiceTimeSlotEnum(String label, String desc) {
        this.label = label;
        this.desc = desc;
    }
    public static String getLabel(String desc) {
        for (ServiceTimeSlotEnum serviceTimeSlotEnum : values()) {
            if (serviceTimeSlotEnum.getDesc().equals(desc)) {
                return serviceTimeSlotEnum.getLabel();
            }
        }
        return "MORNING";
    }

    public static String getDesc(String label) {
        for (ServiceTimeSlotEnum serviceTimeSlotEnum : values()) {
            if (serviceTimeSlotEnum.getLabel().equals(label)){
                return serviceTimeSlotEnum.getDesc();
            }
        }
        return "08:00-12:00";
    }
}
