api-domain.js 6.77 KB
const _ = require('lodash');

// api调用列表
let domainApis = {
    erp: {
        login: '/erp-shop-web/account/profile/login',
        getPurview: '/erp-shop-web/account/menu/query_by_pid',
        allotList: '/erp-shop-web/purchase/queryPurchaseList',
        allotPurchaseList: '/erp-shop-web/purchase/list',
        allotDelivery: '/erp-shop-web/purchase/delivery',
        allotExpressList: '/erp-shop-web/purchase/expressList',
        allotExpressDetail: '/erp-shop-web/purchase/expressDetail',
        allotWarehouseInfo: '/erp-shop-web/purchase/queryBySupplierId',
        allotStockOut: '/erp-shop-web/purchase/stockOut',
        allotExpressNumList: '/erp-shop-web/purchase/queryExpressListByExpressNumber',
        allotExpressCompList: '/erp-shop-web/express/getExpressList',
        allotExportList: '/erp-shop-web/export/exportForPurchaseForm',
        allotPrintExpressDetail: '/erp-shop-web/purchase/queryExpressListByExpressNumber',
        returnSupplierList: '/erp-shop-web/logistics/returnedSupplier/list',
        returnSupplierDetail: '/erp-shop-web/logistics/returnedSupplier/detail',
        exportProductReturnList: '/erp-shop-web/export/exportReturnForInvoice',
        exportProductReturnDetail: '/erp-shop-web/export/exportReturnDetailForInvoice',
        jitProductList: '/erp-shop-web/product/jitProductList',
        getJitStorageListBySkn: '/erp-shop-web/product/getJitStorageListBySkn',
        importJitStorage: '/erp-shop-web/product/importJitStorage',
        invoiceList: '/erp-shop-web/invoice/list',
        storerooms: '/erp-shop-web/invoice/storerooms',
        invoiceInfo: '/erp-shop-web/invoice/info',
        invoiceCreate: '/erp-shop-web/invoice/create',
        invoiceUpdate: '/erp-shop-web/invoice/update',
        invoiceDelete: '/erp-shop-web/invoice/delete',
        invoiceCommit: '/erp-shop-web/invoice/commit',
        invoiceSend: '/erp-shop-web/invoice/goods/sendExpress',
        goodsList: '/erp-shop-web/invoice/goods/list',
        invoiceGoodsAvailable: '/erp-shop-web/invoice/goods/available',
        expressList: '/erp-shop-web/purchase/expressList',
        expressDetail: '/erp-shop-web/purchase/expressDetail',
        expressExport: '/erp-shop-web/export/exportExpressForInvoice',
        invoiceGoodsAdd: '/erp-shop-web/invoice/goods/add',
        invoiceGoodsUpdate: '/erp-shop-web/invoice/goods/update',
        invoiceGoodsDelete: '/erp-shop-web/invoice/goods/delete',
        supplementProductList: '/erp-shop-web/supplementProduct/list',
        invoiceGoodsImport: '/erp-shop-web/invoice/goods/import',
        balanceList: '/erp-shop-web/financeBill/balanceList',
        balanceDetail: '/erp-shop-web/financeBill/balanceDetail',
        settlementList: '/erp-shop-web/financeBill/settlementList',
        inventoryLedgerList: '/erp-shop-web/inventoryLedger/list',
        exportBalanceList: '/erp-shop-web/export/exportBalanceList',
        exportSettlementDetail: '/erp-shop-web/export/exportSettlementDetail',
        exportBalanceDetail: '/erp-shop-web/export/exportBalanceDetail',
        balanceDetailSum: '/erp-shop-web/financeBill/balanceDetailSum',
        settlementListSum: '/erp-shop-web/financeBill/settlementListSum',
        defectGoodsList: '/erp-shop-web/defectGoods/list',
        defectGoodsImg: '/erp-shop-web/defectGoods/detail'
    },
    platform: {
        queryShopsByAdminPid: '/SellerShopController/queryShopsByAdminPid',
        getSellerBrandInfo: '/SellerProductController/getSellerBrandInfo',
        getSellerSortInfo: '/SellerProductController/getSellerSortInfo',
        querySellerProductColors: '/SellerProductController/querySellerProductColors',
        querySortSize: '/SellerSortSizeController/querySortSize',
        addProduct: '/SellerProductController/addProduct',
        queryProductParamBySortId: '/SellerStandardController/queryProductParamBySortId',
        selectAttributes: '/SellerProductAttributeController/selectAttributes',
        querySellerProductMaterial: '/SellerProductController/querySellerProductMaterial',
        updateSellerProductNetSaleInfo: '/SellerProductController/updateSellerProductNetSaleInfo',
        querySellerProductList: '/SellerProductController/querySellerProductList',
        queryVipProductList: '/sellerVip/queryProductVipList',
        changeVipPriceStatus: '/sellerVip/batchChangeStatus',
        productOutSale: '/SellerSknStatusController/productOutSale',
        productOnSale: '/SellerSknStatusController/productOnSale',
        queryProdSizeList: '/SellerProductSize/queryProdSizeList',
        saveProdSizeInfo: '/SellerProductSize/saveProdSizeInfo',
        getSellerAllSortInfo: '/SellerProductController/getSellerAllSortInfo',
        exportSellerProductList: '/SellerProductController/exportSellerProductList',
        updateSellerPrice: '/SellerPriceController/updateSellerPrice',
        updateProduct: '/SellerProductController/updateProduct',
        getProduct: '/SellerProductController/getProduct',
        getShopDetailById: '/SellerShopController/getShopDetailById',
        updateShopBaseInfoById: '/SellerShopController/updateShopBaseInfoById',
        uploads: '/fileupload/uploads',
        findBusinessShopsDecorator: '/ShopsDecoratorRest/findBusinessShopsDecorator',
        getShopsCategoryList: '/SellerShopController/getShopsCategoryList',
        addOrUpdateShopsCategory: '/SellerShopController/addOrUpdateShopsCategory',
        deleteShopsCategory: '/SellerShopController/deleteShopsCategory',
        getAllProduct: '/SellerShopController/getAllProduct',
        getBindProductCount: '/SellerShopController/getBindProductCount',
        getBindProduct: '/SellerShopController/getBindProduct',
        addCategoryLinkProduct: '/SellerShopController/addCategoryLinkProduct',
        deleteCategoryLinkProduct: '/SellerShopController/deleteCategoryLinkProduct',
        getRemoteImageUrlBySku: '/product/getRemoteImageUrlBySku',
        importSeller: '/batch/importSeller',
        downloadFile: '/exceltemplate/download/CreateProductForShops',
        getSellType: '/SellerProductController/getSellType'
    },
    shop: {
        login: '/loginInter',
        switchShop: '/index/ajaxshop'
    }
};

// 域名列表
const domains = {
    erp: 'http://192.168.103.82:9098',
    platform: 'http://192.168.102.210:8088/platform',
    shop: 'http://192.168.102.211:30016'
};


if (global.env.Test) {
    domains.erp = 'http://192.168.103.82:9098';
    domains.platform = 'http://192.168.102.202:8088/platform';
    domains.shop = 'http://192.168.102.211:30016';
}

if (global.env.Production) {
    domains.erp = 'http://gw.api.yohobuy.com';
    domains.platform = 'http://api.platform.yohoops.org/platform';
    domains.shop = 'http://127.0.0.1:30016';
}

_.each(domainApis, (apis, domainName) => {
    _.each(apis, (url, api) => {
        apis[api] = _.get(domains, domainName, '') + url;
    });
});

module.exports = domainApis;