import axiosInstance from "@/api/axios.ts";
import type {IStackerInfoTableData} from "@/model/table/IStackerInfoTableData.ts";
import type IStackerStandTableData from "@/model/table/IStackerStandTableData.ts";

export default class StackerApi {

    // 查询堆垛机信息
    static queryStackerInfo(stackerName: string) {
        return axiosInstance.get("app/stacker/queryStackerInfo", {
            params: {
                stackerName: stackerName
            }
        });
    };
    // 插入一条数据
    static addStackerInfo(stackerInfo: IStackerInfoTableData) {
        return axiosInstance.post("app/stacker/addStackerInfo", stackerInfo);
    };
    // 更新一条数据
    static updateStackerInfo(stackerInfo: IStackerInfoTableData) {
        return axiosInstance.post("app/stacker/updateStackerInfo", stackerInfo);
    };
    // 查询站台信息
    static queryStandInfo(stackerId: number) {
        return axiosInstance.get("app/stacker/queryStackerStand", {
            params: {
                stackerId: stackerId
            }
        });
    };
    // 插入或者更新一条站台数据
    static addOrUpdateStandInfo(standInfo: IStackerStandTableData) {
        return axiosInstance.post("app/stacker/addOrUpdateStackerStand", standInfo);
    };
    // 删除一条站台数据
    static deleteStandInfo(standId: string) {
        return axiosInstance.delete("app/stacker/deleteWithStandId/" + standId);
    };
    // 获取堆垛机运行信息
    static getStackerRunningInfo() {
        return axiosInstance.get("app/stacker/getStackerRunningInfo");
    }

}