const vatClient = require("./vatClient")
const wangwenClient = require("./wangwenClient")
const system = require("../../system");


/**
 * 根据产品类型选择不同的方法
 * @param {*} type 
 */
function getClientByType(type) {
    switch (type) {
        case system.SERVICECODE.ICP:
        case system.SERVICECODE.EDI:
            return new vatClient()
        case system.SERVICECODE.WANGWEN:
            return new wangwenClient()
        default:
            throw new Error("此状态手动不能更改");
    }
}

module.exports = {
    vatClient: new vatClient(),
    wangwenClient: new wangwenClient(),
    getClientByType
}