package com.purui.prims.headless.api.pojo.enums;

/**
 * DolphinScheduler业务类型
 *
 * @author charlie
 * @date 2024/7/9
 */
public enum DolphineSchedulerType {

    PROJECT_LIST("projects/list", "GET"),

    PROJECT_CREATE("projects", "POST"),

    TASK_LIST("projects/{projectCode}/task-definition", "GET"),
    TASK_CREATE("projects/{projectCode}/task-definition/save-single", "POST"),
    TASK_DETAIL("projects/{projectCode}/task-definition/{code}", "GET"),
    TASK_UPDATE("projects/{projectCode}/task-definition/{code}/with-upstream", "PUT"),
    TASK_REMOVE("projects/{projectCode}/task-definition/{code}", "DELETE"),
    TASK_INSTANCE_LIST("projects/{projectCode}/task-instances", "GET"),
    TASK_LOG("log/detail", "GET"),
    TASK_RUN_NOW("projects/{projectCode}/executors/task-instance/{code}/start", "POST"),

    PROCESS_RUN_NOW("projects/{projectCode}/executors/start-process-instance", "POST"),
    PROCESS_DETAIL("projects/{projectCode}/process-definition/{code}", "POST"),

    WORKFLOW_CREATE("projects/{projectCode}/process-definition", "POST"),
    WORKFLOW_LIST("projects/{projectCode}/process-definition", "GET"),
    WORKFLOW_UPDATE("projects/{projectCode}/process-definition/{code}", "PUT"),
    WORKFLOW_DETAIL("projects/{projectCode}/process-definition/{code}", "GET"),
    WORKFLOW_REMOVE("projects/{projectCode}/process-definition/{code}", "DELETE"),
    WORKFLOW_RELEASE("projects/{projectCode}/process-definition/{code}/release", "POST"),

    SCHEDULE_CREATE("projects/{projectCode}/schedules", "POST"),
    SCHEDULE_ONLINE("projects/{projectCode}/schedules/{id}/online", "POST"),
    SCHEDULE_OFFLINE("projects/{projectCode}/schedules/{id}/offline", "POST"),
    SCHEDULE_LIST("projects/{projectCode}/schedules/list", "POST"),

    DATASOURCE_LIST("datasources/list", "GET"),



    TASK_GEN_CODE("projects/{projectCode}/task-definition/gen-task-codes", "GET");


    private String uri;
    private String method;

    DolphineSchedulerType(String uri, String method) {
        this.uri = uri;
        this.method = method;
    }

    public String getUri() {
        return uri;
    }

    public String getMethod() {
        return method;
    }
}
