import { tmallabHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';

enum Api {
  listContract = '/system/vipContract/listContract',
  list = '/system/plat/list',
  createAccount = '/system/plat/createAccount',
  batchClosePlats = '/system/supplier/batchClosePlats',
  stopPlatAccount = '/system/supplier/stopPlatAccount',
  batchOpenPlats = '/system/supplier/batchOpenPlats',
  getGhsBondedPlatform = '/system/supplier/getGhsBondedPlatform',
  listInfoAdmin = '/system/supplier/listInfoAdmin',
  listContactInfo = '/system/supplier/listContactInfo',
  listBingState = '/system/supplier/listBingState',
  updateGhsInfoByGhsCode = '/system/supplier/updateGhsInfoByGhsCode',
  updatePwd = '/system/supplier/updatePwd',
  updateExPlatform = '/system/supplier/updateExPlatform',
  listLogAccountManagement = '/system/supplier/listLogAccountManagement',
  updateLimitNum = '/system/supplier/updateLimitNum',
  getLimitLog = '/system/supplier/getLimitLog',
  operateisSc = '/system/supplier/operateisSc',
}

/**
 * @description:
 */
export function listContractApi(data: any, mode: ErrorMessageMode = 'message') {
  return tmallabHttp.post<any>(
    {
      url: Api.listContract,
      data,
    },
    {
      errorMessageMode: mode,
    },
  );
}

/**
 * @description:
 */
export function listApi(data: any, mode: ErrorMessageMode = 'message') {
  return tmallabHttp.post<any>(
    {
      url: Api.list,
      data,
    },
    {
      errorMessageMode: mode,
    },
  );
}

/**
 * @description:
 */
export function createAccountApi(data: any, mode: ErrorMessageMode = 'message') {
  return tmallabHttp.post<any>(
    {
      url: Api.createAccount,
      data,
    },
    {
      errorMessageMode: mode,
    },
  );
}

/**
 * @description:
 */
export function batchClosePlatsApi(data: any, mode: ErrorMessageMode = 'message') {
  return tmallabHttp.post<any>(
    {
      url: Api.batchClosePlats,
      data,
    },
    {
      errorMessageMode: mode,
    },
  );
}

/**
 * @description:
 */
export function stopPlatAccountApi(data: any, mode: ErrorMessageMode = 'message') {
  return tmallabHttp.post<any>(
    {
      url: Api.stopPlatAccount,
      data,
    },
    {
      errorMessageMode: mode,
    },
  );
}
/**
 * @description:
 */
export function batchOpenPlatsApi(data: any, mode: ErrorMessageMode = 'message') {
  return tmallabHttp.post<any>(
    {
      url: Api.batchOpenPlats,
      data,
    },
    {
      errorMessageMode: mode,
    },
  );
}
/**
 * @description:
 */
export function getGhsBondedPlatformApi(data: any, mode: ErrorMessageMode = 'message') {
  return tmallabHttp.post<any>(
    {
      url: Api.getGhsBondedPlatform,
      data,
    },
    {
      errorMessageMode: mode,
    },
  );
}
/**
 * @description:
 */
export function listInfoAdminApi(data: any, mode: ErrorMessageMode = 'message') {
  return tmallabHttp.post<any>(
    {
      url: Api.listInfoAdmin,
      data,
    },
    {
      errorMessageMode: mode,
    },
  );
}
/**
 * @description:
 */
export function listContactInfoApi(data: any, mode: ErrorMessageMode = 'message') {
  return tmallabHttp.post<any>(
    {
      url: Api.listContactInfo,
      data,
    },
    {
      errorMessageMode: mode,
    },
  );
}
/**
 * @description:
 */
export function listBingStateApi(data: any, mode: ErrorMessageMode = 'message') {
  return tmallabHttp.post<any>(
    {
      url: Api.listBingState,
      data,
    },
    {
      errorMessageMode: mode,
    },
  );
}
/**
 * @description:
 */
export function updateGhsInfoByGhsCodeApi(data: any, mode: ErrorMessageMode = 'message') {
  return tmallabHttp.post<any>(
    {
      url: Api.updateGhsInfoByGhsCode,
      data,
    },
    {
      errorMessageMode: mode,
    },
  );
}
/**
 * @description:
 */
export function updatePwdApi(data: any, mode: ErrorMessageMode = 'message') {
  return tmallabHttp.post<any>(
    {
      url: Api.updatePwd,
      data,
    },
    {
      errorMessageMode: mode,
    },
  );
}
/**
 * @description:
 */
export function updateExPlatformApi(data: any, mode: ErrorMessageMode = 'message') {
  return tmallabHttp.post<any>(
    {
      url: Api.updateExPlatform,
      data,
    },
    {
      errorMessageMode: mode,
    },
  );
}
/**
 * @description:
 */
export function listLogAccountManagementApi(data: any, mode: ErrorMessageMode = 'message') {
  return tmallabHttp.post<any>(
    {
      url: Api.listLogAccountManagement,
      data,
    },
    {
      errorMessageMode: mode,
    },
  );
}
/**
 * @description:
 */
export function updateLimitNumApi(data: any, mode: ErrorMessageMode = 'message') {
  return tmallabHttp.post<any>(
    {
      url: Api.updateLimitNum,
      data,
    },
    {
      errorMessageMode: mode,
    },
  );
}
/**
 * @description:
 */
export function getLimitLogApi(data: any, mode: ErrorMessageMode = 'message') {
  return tmallabHttp.post<any>(
    {
      url: Api.getLimitLog,
      data,
    },
    {
      errorMessageMode: mode,
    },
  );
}
/**
 * @description: 开通区域现货
 */
export function operateisScApi(data: any, mode: ErrorMessageMode = 'message') {
  return tmallabHttp.post<any>(
    {
      url: Api.operateisSc,
      data,
    },
    {
      errorMessageMode: mode,
    },
  );
}
