import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { Station, StationDevice } from "./types";

/**
 * 修改工位
 *
 * @param id
 * @param data
 */
export function updateStation(data: Station) {
  return request({
    url: "/api/v1/base/station/update",
    method: "post",
    data: data,
  });
}

export function bindStation(data: Station) {
  return request({
    url: "/api/v1/base/station/bind",
    method: "post",
    data: data,
  });
}

/**
 * 工位绑定设备
 *
 * @param id
 * @param data
 */
export function addStationDevice(data: object) {
  return request({
    url: "/api/v1/base/stationDevice/add",
    method: "post",
    data: data,
  });
}

export function queryStationByLineId(lineId: any) {
  return request({
    url: "/api/v1/base/station/queryStationByLineId/" + lineId,
    method: "get",
  });
}
