import { http } from "@/utils/http";

/** 站点列表 */
export const getStationList = (data?: object) => {
  return http.request<any>("post", "/washStation/list", { data });
};

/** 站点详情 */
export const getStationDetail = (id: number) => {
  return http.request<any>("get", `/washStation/detail/${id}`);
};

/** 删除站点 */
export const removeStation = (id: number) => {
  return http.request<any>("get", `/washStation/remove/${id}`);
};

/** 修改站点 */
export const modifyStation = (data: object) => {
  return http.request<any>("post", "/washStation/modify", { data });
};

/** 新增站点 */
export const addStation = (data: object) => {
  return http.request<any>("post", "/washStation/add", { data });
};

/** 站点账户列表 */
export const getStationAccount = (data?: object) => {
  return http.request<any>("post", "/finance/stationAccounts", { data });
};

/** 申请提现 */
export const applyWithdrawn = (data: { stationId: string; amount: number }) => {
  return http.request<any>("post", "/finance/applyWithdrawn", { data });
};

/** 设备列表 */
export const getStationDeviceList = (data?: object) => {
  return http.request<any>("post", "/washDevice/list", { data });
};

/** 设备详情 */
export const getDeviceDetail = (id: number) => {
  return http.request<any>("get", `/washDevice/detail/${id}`);
};

/** 删除设备 */
export const removeDevice = (id: number) => {
  return http.request<any>("get", `/washDevice/remove/${id}`);
};

/** 修改设备 */
export const modifyDevice = (data: object) => {
  return http.request<any>("post", "/washDevice/modify", { data });
};

/** 导入站点 */
export const importStation = (data: object) => {
  return http.request<any>("post", "/station/importStation", { data });
};

/** 导入设备 (复用站点导入接口) */
export const importDevice = (data: object) => {
  return http.request<any>("post", "/station/importStation", { data });
};

/** 设备远程控制 */
export const deviceRemoteApi = (url: string, data: object) => {
  return http.request<any>("post", `/washDevice/remote/${url}`, { data });
};

