/**
 * 收货地址 api 封装
 *
 * @Author:    hj
 * @Date:      2024-12-26 15:35:23
 * @Copyright  友仓
 */
import {postRequest, getRequest,getDownload} from '/@/lib/axios';

export const addressApi = {

    /**
     * 分页查询  @author  hj
     */
    queryPage: (param) => {
        return postRequest('/address/queryPage', param);
    },

    /**
     * 增加  @author  hj
     */
    add: (param) => {
        return postRequest('/address/add', param);
    },

    /**
     * 修改  @author  hj
     */
    update: (param) => {
        return postRequest('/address/update', param);
    },


    /**
     * 删除  @author  hj
     */
    delete: (addressId: number) => {
        return getRequest('/address/delete', {addressId});
    },

    /**
     * 批量删除  @author  hj
     */
    batchDelete: (idList: number[]) => {
        return postRequest('/address/batchDelete', idList);
    },

    /**
     * 下拉查询  @author  hj
     */
    queryAddress: (param: object) => {
        return postRequest('/address/queryAddress', param);
    },

    /**
     * 导入  @author  hj
     */
    importAddress: (file: object) => {
        return postRequest('/address/importAddress', file);
    },

    /**
     * 导出  @author  hj
     */
    exportAddress: () => {
        return getDownload('/address/exportAddress',{});
    }

};
