package com.ai.da.common.enums;

import java.util.stream.Stream;

/**
 * @author yanglei
 * @description python调用java 操作数类型 generatePrint ->生成印花 designCollection ->设计collection generateSketch->设计草图
 * @create 2022-10-3 17:33
 **/
public enum PythonToJavaApiOperationTypeEnum {
    /**
     * 生成印花
     */
    GENERATE_PRINT("generatePrint"),
    /**
     * 生成高级design
     */
    GENERATE_ADVANCED_DESIGN("generateAdvancedDesign"),
    /**
     * 设计collection
     */
    DESIGN_COLLECTION("designCollection"),

    /**
     * 生成草图
     */
    GENERATE_SKETCH("generateSketch");

    private String realName;

    PythonToJavaApiOperationTypeEnum(String realName) {
        this.realName = realName;
    }

    public String getRealName() {
        return realName;
    }

    public static PythonToJavaApiOperationTypeEnum uploadOf(String realName) {
        return Stream.of(PythonToJavaApiOperationTypeEnum.values()).filter(v -> v.getRealName().equals(realName)).findFirst().orElse(null);
    }
}
