import type {IQuartzSearch} from "@/interface/page/quartz/IQuartzSearch.ts";
import axiosInstance from "@/api/axios.ts";
import type {IQuartzTableData} from "@/model/table/IQuartzTableData.ts";

export default class QuartzApi {

    // 查询定时任务数据
    static query(queryData: IQuartzSearch) {
        return axiosInstance.post("/app/quartz/query", queryData);
    }

    // 添加定时任务数据
    static addQuartzConfig(addData: IQuartzTableData) {
        return axiosInstance.post("/app/quartz/addQuartzConfig", addData);
    }

    // 删除任务数据
    static deleteQuartzConfig(className: string) {
        return axiosInstance.delete("/app/quartz/deleteQuartzConfig/" + className);
    }

    // 停止一个定时任务
    static stopQuartzConfig(className: string) {
        return axiosInstance.put("/app/quartz/stopQuartzJob/" + className);
    }

    // 启动一个定时任务
    static startQuartzConfig(className: string) {
        return axiosInstance.put("/app/quartz/startQuartzJob/" + className);
    }

    // 更新定时任务数据
    static updateQuartzConfig(updateData: IQuartzTableData) {
        return axiosInstance.post("/app/quartz/updateQuartzConfig", updateData);
    }


}