const path = require('path');
const config = {
    '/hdtool/ajaxElement': {
        data: 'ajaxElement'
    },
    // 屈臣氏
    '/projectx/getDomain.query': {
        data: 'getDomain'
    },
    '/projectx/{peojextId}/w7d23fd8b/a03828e7a.do': {
        data: 'getCount'
    },
    '/projectx/{peojextId}/{strategyId}.query': {
        data: 'queryPrizeList'
    },
    '/projectx/{peojextId}/credits/creditsCost.do': {
        data: 'creditsCost'
    },
    '/projectx/{peojextId}/credits/queryStatus.do': {
        data: 'queryStatus'
    },
    '/projectx/{peojextId}/w7d23fd8b/doJoin.do': {
        data: 'getPrize'
    },
    '/projectx/{peojextId}/prize.query': {
        data: 'queryPrizeInfo'
    },
    '/aaw/projectx/getCouponInfo': {
        data: 'getCouponInfo'
    },
    '/projectx/{peojextId}/records.query': {
        data: 'queryRecords'
    },
    '/ctool/getProjectUserInfo': {
        data: 'getProjectUserInfo'
    },
}

let peojextId = 'pa2340903';
let strategyId = 'strategyId';

for (let item in config) {
    if (config.hasOwnProperty(item)) {
        if (item.indexOf("{peojextId}") != -1 || item.indexOf("{strategyId}") != -1) {
            let newKey = item.replace("{peojextId}", peojextId);
            newKey = newKey.replace("{strategyId}", strategyId);
            config[newKey] = config[item];
            delete config[item];
            item = newKey;
        }
        config[item].path = path.resolve(__dirname, "./json/" + config[item].data + ".json");
    }
}
module.exports = config;