import http from "@/http/http";
import { PartitionModelDto } from "./partitionModel";

enum Api {
    export = '/api/partitionModel/export',
    partitionModelList = '/api/partitionModel/partitionModelList',
    partitionModelLoad = '/api/partitionModel/partitionModelLoad',
    downloadCountryPartition = '/api/fileModel/downloadCountryPartition',
    downloadZipCodeArea = '/api/fileModel/downloadZipCodeArea'
}

//分区模版导出
export const getPartitionExportApi = async (parms: PartitionModelDto) => {
    return await http.post(Api.export, parms)
}

// 加载分区下拉列表框数据
export const getPartitionModelListApi = async () => {
    return await http.get(Api.partitionModelList)
}

// 分区加载
export const getPartitionModelLoadApi = async (id: string) => {
    return await http.get(Api.partitionModelLoad, { id })
}

// 导出xlsx文件
export const api_DownloadCountryPartition = async (parms: Recordable) => {
    return await http.download(Api.downloadCountryPartition, parms)
}

// 导出邮编xlsx文件
export const api_downloadZipCodeArea = async (parms: Recordable) => {
    return await http.download(Api.downloadZipCodeArea, parms)
}