import { request } from "../../config";

// 查询金蝶参数
export function getSynchronization() {
  return request({
    url: "/api/init/connect/param",
    method: "get",
  });
}

// 保存金蝶参数
export function putSynchronization(data: any) {
  return request({
    url: "/api/init/connect/param/create",
    method: "post",
    data,
  });
}

// 手动开启同步
export function getManual() {
  return request({
    url: "/api/manual/synchronization",
    method: "get",
  });
}
// 开启自动同步
export function getStart() {
  return request({
    url: "/api/start/synchronization",
    method: "get",
  });
}
// 关闭自动同步
export function getOff() {
  return request({
    url: "/api/turn/off/synchronization",
    method: "get",
  });
}

// 手动重新同步错误同步
export function getabnormal() {
  return request({
    url: "/api/abnormal/synchronization",
    method: "get",
  });
}

// 查询同步状态
export function getSRecords() {
  return request({
    url: "/api/synchronization/records",
    method: "get",
  });
}

// 校验
export function getCheck(data: any) {
  return request({
    url: "/api/init/connect/param/check",
    method: "post",
    data,
  });
}

// 导入文件 /api/lic/info/file/import
export function importFile(data: any) {
  return request({
    url: "/api/lic/info/file/import",
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data
  })
}

// 查询金蝶参数
export function getConnectParam() {
  return request({
    url: "/api/mall/init/common/param",
    method: "get",
  });
}

// 保存金蝶参数
export function putConnectParam(data: any) {
  return request({
    url: "/api/mall/init/common/param/create",
    method: "post",
    data,
  });
}

// 获取mac地址 /api/mac/address/detail
export function getMacAddress() {
  return request({
    url: "/api/mac/address/detail",
    method: "get",
  });
}
