package com.yuchen.saas.park.api.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author 肖祥
 * @date 2022/10/20 17:11
 * 计划状态:1、未开始2、进行中3、已结束
 */
@Getter
@AllArgsConstructor
public enum PlanStatusEnum {

    NO_START(1, "未开始"),

    STARTING(2, "进行中"),

    OVER(3, "已结束");

    private Integer code;

    private String description;

    public static String getDescByCode(Integer code) {
        PlanStatusEnum[] maskEnumArray = PlanStatusEnum.values();
        for (PlanStatusEnum maskEnum : maskEnumArray) {
            if (maskEnum.getCode().equals(code)) {
                return maskEnum.getDescription();
            }
        }
        return NO_START.description;
    }
}
