All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dingtalk.baymax.framework.sdk.mercury.plugin.BasePluginAPI Maven / Gradle / Ivy

There is a newer version: 1.0.2
Show newest version
package com.dingtalk.baymax.framework.sdk.mercury.plugin;

import com.alibaba.fastjson.JSONObject;

import java.util.Map;

/**
 * @author: jzc
 * Time: 2023/6/9 3:30 PM
 */
public abstract class BasePluginAPI extends BaseTool {
    /**
     * api唯一标识,其值为 [pluginInstanceId]<>[version]<>[apiId]
     */
    protected String openApiId;
    /**
     * 插件实例id
     */
    protected String pluginInstanceId;

    /**
     * 插件id
     */
    protected String pluginId;

    /**
     * 插件版本号
     */
    protected String version;
    /**
     * 接口id
     */
    protected String apiId;

    /**
     * 插件所属应用id
     */
    protected String unifiedAppId;
    /**
     * 接口类型
     */
    protected String type;

    /**
     * 模型可读名称
     */
    protected String nameForModel;
    /**
     * 模型可读描述
     */
    protected String descriptionForModel;

    /**
     * 模型可读参数列表
     */
    protected Map inputForModel;

    /**
     * 模型预配置参数列表
     */
    protected Map configForModel;

    /**
     * 模型可读输出
     */
    protected Map outputForModel;

    /**
     * 插件使用示例(对于rpa插件来说,example为示例代码)
     */
    protected String example;

    /**
     * 不同类型api的特性
     */
    protected JSONObject feature;

    /**
     * api配置参数
     */
    protected ToolConfigParam apiConfigParam;

    /**
     * 鉴权参数
     */
    protected ToolAuthentication authentication;

    public String getOpenApiId() {
        return openApiId;
    }

    public void setOpenApiId(String openApiId) {
        this.openApiId = openApiId;
    }

    public String getPluginInstanceId() {
        return pluginInstanceId;
    }

    public void setPluginInstanceId(String pluginInstanceId) {
        this.pluginInstanceId = pluginInstanceId;
    }

    public String getPluginId() {
        return pluginId;
    }

    public void setPluginId(String pluginId) {
        this.pluginId = pluginId;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getApiId() {
        return apiId;
    }

    public void setApiId(String apiId) {
        this.apiId = apiId;
    }

    public String getUnifiedAppId() {
        return unifiedAppId;
    }

    public void setUnifiedAppId(String unifiedAppId) {
        this.unifiedAppId = unifiedAppId;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getNameForModel() {
        return nameForModel;
    }

    public void setNameForModel(String nameForModel) {
        this.nameForModel = nameForModel;
    }

    public String getDescriptionForModel() {
        return descriptionForModel;
    }

    public void setDescriptionForModel(String descriptionForModel) {
        this.descriptionForModel = descriptionForModel;
    }

    public Map getInputForModel() {
        return inputForModel;
    }

    public void setInputForModel(Map inputForModel) {
        this.inputForModel = inputForModel;
    }

    public Map getConfigForModel() {
        return configForModel;
    }

    public void setConfigForModel(Map configForModel) {
        this.configForModel = configForModel;
    }

    public Map getOutputForModel() {
        return outputForModel;
    }

    public void setOutputForModel(Map outputForModel) {
        this.outputForModel = outputForModel;
    }

    public String getExample() {
        return example;
    }

    public void setExample(String example) {
        this.example = example;
    }

    public JSONObject getFeature() {
        return feature;
    }

    public void setFeature(JSONObject feature) {
        this.feature = feature;
    }

    public ToolConfigParam getApiConfigParam() {
        return apiConfigParam;
    }

    public void setApiConfigParam(ToolConfigParam apiConfigParam) {
        this.apiConfigParam = apiConfigParam;
    }

    public ToolAuthentication getAuthentication() {
        return authentication;
    }

    public void setAuthentication(ToolAuthentication authentication) {
        this.authentication = authentication;
    }

    public JSONObject getMetaForModel() {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("apiId", this.apiId);
        jsonObject.put("nameForModel", this.nameForModel);
        jsonObject.put("descriptionForModel", this.descriptionForModel);
        jsonObject.put("inputForModel", JSONObject.toJSONString(inputForModel));
        jsonObject.put("outputForModel", JSONObject.toJSONString(outputForModel));
        jsonObject.put("example", this.example);
        return jsonObject;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy