package cn.axzo.workflow.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * @author syl
 * @date 2023/11/21
 */
@Getter
@AllArgsConstructor
public enum WorkspaceType {

    /**
     * 工作台类型
     * 1- 企业 2-项目 6-oms
     */
    ENT(1, "企业"),
    PROJECT(2, "项目"),
    GOVERNMENT(3, "政务监管平台"),
    OMS(6, "oms工作台"),
    UN_KNOW(0, "未知"),
    ;

    private final Integer code;
    private final String desc;

    public static WorkspaceType getType(Integer code) {
        return Arrays.stream(values()).filter(it -> it.getCode().equals(code))
                .findFirst()
                .orElse(null);
    }
}
