package com.hzs.common.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 服务协议状态枚举
 */
@AllArgsConstructor
@Getter
public enum EServiceStatus {

    /**
     * 已签署
     */
    SIGNED(0, "已签署"),

    /**
     * 未签署
     */
    UNSIGNED(1, "未签署"),

    ;

    /**
     * 实际值
     */
    private final int value;
    /**
     * 显示标签
     */
    private final String label;

    /**
     * 根据值，获取枚举
     *
     * @param val
     * @return
     */
    public static EServiceStatus getEnumByValue(int val) {
        for (EServiceStatus value : EServiceStatus.values()) {
            if (value.getValue() == val) {
                return value;
            }
        }
        return null;
    }

}
