const CMD = {}
const HttpClient = require('../../../src/HttpClient')
const config = require('../../../etc/config.json')
const helper = require('../../helper')

// 渠道列表查询接口(新)
CMD.get_channel_Info_list = async function(is_wx,call_back){
    let clinet = new HttpClient()
    let timestamp = Date.now()
    let response = null
    let signKey  = null
    if(is_wx){
        signKey = helper.md5(config.dianzhong_channel_config.clientId+config.dianzhong_channel_config.token+timestamp)
        response = await clinet.post(config.dianzhong_channel_config.channelInfoList,{
            clientId:config.dianzhong_channel_config.clientId,
            timestamp:timestamp,
            signKey:signKey
        })
    }else{
        signKey = helper.md5(config.dianzhong_config.clientId+config.dianzhong_config.token+timestamp)
        response = await clinet.post(config.dianzhong_channel_config.channelInfoList,{
            clientId:config.dianzhong_config.clientId,
            timestamp:timestamp,
            signKey:signKey
        })
    }
    call_back(response)
}
module.exports = CMD;