import request from "@/api/request";
import type { ID } from "@/api/common";
import type { MesStationQuery, MesStationData } from "./model";

// 查询站点列表
export function listStation(params: MesStationQuery) {
  return request({
    url: "/mes/station/list",
    method: "get",
    params,
  });
}

// 高级查询站点列表
export function advListStation(params: MesStationQuery) {
  return request({
    url: "/mes/station/advList",
    method: "get",
    params,
  });
}

// 查询站点详细
export function getStation(id: ID) {
  return request({
    url: "/mes/station/" + id,
    method: "get",
  });
}

// 新增站点
export function addStation(data: MesStationData) {
  return request({
    url: "/mes/station",
    method: "post",
    data,
  });
}

// 修改站点
export function updateStation(data: MesStationData) {
  return request({
    url: "/mes/station",
    method: "put",
    data,
  });
}

// 删除站点
export function delStation(id: ID) {
  return request({
    url: "/mes/station/" + id,
    method: "delete",
  });
}

// 站点开工
export function startStation(id: ID) {
  return request({
    url: "/mes/station/" + id + "/start",
    method: "put",
  });
}
