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

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author 肖祥
 * @date 2022/10/20 17:11
 * 巡查周期:1、每日一次2、每日多次3、每周一次4、每月一次
 */
@Getter
@AllArgsConstructor
public enum PlanCycleEnum {

    DAY_ONE(1, "每日一次"),

    DAY_MORE(2, "每日多次"),

    WEEK_ONE(3, "每周一次"),

    MOTH_ONE(4,"每月一次");

    private Integer code;

    private String description;

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