package com.sundot.airport.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 加扣分类型枚举
 */
@Getter
@AllArgsConstructor
public enum ScoreTypeEnum {

    ALL("0", "全部"),
    PLUS("1", "加分"),
    REDUCE("2", "扣分");

    private final String code;
    private final String desc;

    public static ScoreTypeEnum getByCode(String code) {
        for (ScoreTypeEnum itemEnum : values()) {
            if (itemEnum.getCode().equals(code)) {
                return itemEnum;
            }
        }
        return null;
    }

}
