package com.qmth.themis.business.enums;

import java.util.Objects;

/**
 * @Description: 云阅卷文件上传类型
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2022/9/29
 */
public enum CloudMarkFileUploadTypeEnum {

    JSON("json"),

    PAPER("paper"),

    ANSWER("answer"),

    PDF("pdf");

    private String code;

    private CloudMarkFileUploadTypeEnum(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public static CloudMarkFileUploadTypeEnum convertToEnum(String code) {
        for (CloudMarkFileUploadTypeEnum e : CloudMarkFileUploadTypeEnum.values()) {
            if (Objects.equals(code, e.getCode())) {
                return e;
            }
        }
        return null;
    }
}
