|
@@ -195,6 +195,17 @@ CMD.get_fq_callback_template = async function(res,distributor_id) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+CMD.get_fq_dt_callback_template = async function(res,distributor_id) {
|
|
|
+ let data = await require('../src/api/fq/get_fq_call_back_template').get_dt_callback_template(distributor_id)
|
|
|
+ res.writeHead(200, {'Content-Type': 'application/json'});
|
|
|
+ if(data==null){
|
|
|
+ res.end(JSON.stringify({ message:"成功!",data:{},code:10000}));
|
|
|
+ }else{
|
|
|
+ console.log('get_fq_callback_template:', data);
|
|
|
+ res.end(JSON.stringify({ message:"成功!",data:data,code:10000}));
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
CMD.get_fq_rechargeTemplate = function(res,distributor_id){
|
|
|
// var distributorId = config.fanqie_config.distributorId;
|
|
|
var distributorId = distributor_id
|
|
@@ -229,6 +240,43 @@ CMD.get_fq_rechargeTemplate = function(res,distributor_id){
|
|
|
res.end(JSON.stringify({ message:"fail!",data:data,code:data.code}));
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+CMD.get_fq_dt_rechargeTemplate = function(res,distributor_id){
|
|
|
+ // var distributorId = config.fanqie_config.distributorId;
|
|
|
+ var distributorId = distributor_id
|
|
|
+ var secretKey = config.fanqie_dt_config.secretKey;
|
|
|
+ const postData = {
|
|
|
+ distributor_id: distributorId,
|
|
|
+ ts: helper.getCurrentUnixTimestamp(),
|
|
|
+ sign: helper.getSign(distributorId,secretKey),
|
|
|
+ page_size: 100,
|
|
|
+ page_index:0,
|
|
|
+ };
|
|
|
+ // console.log("get_recharge_template:")
|
|
|
+ var url = config.fanqie_config.recharge_list_host
|
|
|
+ var base_params = `/?distributor_id=${postData.distributor_id}&ts=${postData.ts}&sign=${postData.sign}`
|
|
|
+ var other_params = `&page_size=${postData.page_size}&page_index=${postData.page_index}`
|
|
|
+
|
|
|
+ axios.get(`${url}${base_params}${other_params}`)
|
|
|
+ .then(response => {
|
|
|
+ // console.log('Response data:', response.data );
|
|
|
+ let data = response.data
|
|
|
+ res.writeHead(200, {'Content-Type': 'application/json'});
|
|
|
+ if(data.code==200){
|
|
|
+ let list = data.data
|
|
|
+ res.end(JSON.stringify({ message:"成功!",data:list,code:10000}));
|
|
|
+ }else{
|
|
|
+ res.end(JSON.stringify({ message:"fail!",data:data,code:data.code}));
|
|
|
+ }
|
|
|
+ console.log("get_fq_rechargeTemplate:",data)
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ console.error('Error:', error);
|
|
|
+ res.end(JSON.stringify({ message:"fail!",data:data,code:data.code}));
|
|
|
+ });
|
|
|
+}
|
|
|
// 应用业务类型。枚举值,提供该字段则只返回对应业务类型分包列表
|
|
|
// - 快应用 = 1
|
|
|
// - 微信h5 = 3
|
|
@@ -269,6 +317,72 @@ CMD.get_fq_package_list = function(res,distributorId,app_type){
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+CMD.get_fq_dt_package_list = function(res,distributorId,app_type){
|
|
|
+ var secretKey = config.fanqie_dt_config.secretKey;
|
|
|
+ const postData = {
|
|
|
+ distributor_id: distributorId,
|
|
|
+ ts: helper.getCurrentUnixTimestamp(),
|
|
|
+ sign: helper.getSign(distributorId,secretKey),
|
|
|
+ page_size: 50,
|
|
|
+ page_index:0,
|
|
|
+ app_type:app_type
|
|
|
+ };
|
|
|
+ var url = config.fanqie_config.get_fq_package_list
|
|
|
+ var base_params = `/?distributor_id=${postData.distributor_id}&ts=${postData.ts}&sign=${postData.sign}&app_type=${postData.app_type}`
|
|
|
+ var other_params = `&page_size=${postData.page_size}&page_index=${postData.page_index}`
|
|
|
+
|
|
|
+ console.log("url:",`${url}${base_params}${other_params}`)
|
|
|
+ axios.get(`${url}${base_params}${other_params}`)
|
|
|
+ .then(response => {
|
|
|
+ // console.log('Response data:', response.data );
|
|
|
+ let data = response.data
|
|
|
+ res.writeHead(200, {'Content-Type': 'application/json'});
|
|
|
+ if(data.code==200){
|
|
|
+ res.end(JSON.stringify({ message:"成功!",data:data.package_info_open_list,code:10000}));
|
|
|
+ }else{
|
|
|
+ res.end(JSON.stringify({ message:"fail!",data:data,code:data.code}));
|
|
|
+ }
|
|
|
+ console.log("get_fq_package_list:",data)
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ console.error('Error:', error);
|
|
|
+ res.end(JSON.stringify({ message:"fail!",data:data,code:data.code}));
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+CMD.get_fq_dt_bound_package_list = function(res,distributorId,app_id){
|
|
|
+ var secretKey = config.fanqie_dt_config.secretKey;
|
|
|
+ const postData = {
|
|
|
+ distributor_id: distributorId,
|
|
|
+ ts: helper.getCurrentUnixTimestamp(),
|
|
|
+ sign: helper.getSign(distributorId,secretKey),
|
|
|
+ page_size: 50,
|
|
|
+ page_index:0,
|
|
|
+ app_id:app_id
|
|
|
+ };
|
|
|
+ var url = config.fanqie_dt_config.get_bound_package_list
|
|
|
+ var base_params = `/?distributor_id=${postData.distributor_id}&ts=${postData.ts}&sign=${postData.sign}&app_id=${postData.app_id}`
|
|
|
+ var other_params = `&page_size=${postData.page_size}&page_index=${postData.page_index}`
|
|
|
+
|
|
|
+ console.log("url:",`${url}${base_params}${other_params}`)
|
|
|
+ axios.get(`${url}${base_params}${other_params}`)
|
|
|
+ .then(response => {
|
|
|
+ // console.log('Response data:', response.data );
|
|
|
+ let data = response.data
|
|
|
+ res.writeHead(200, {'Content-Type': 'application/json'});
|
|
|
+ if(data.code==200){
|
|
|
+ res.end(JSON.stringify({ message:"成功!",data:data.wx_package_info_open_list,code:10000}));
|
|
|
+ }else{
|
|
|
+ res.end(JSON.stringify({ message:"fail!",data:data,code:data.code}));
|
|
|
+ }
|
|
|
+ console.log("get_fq_bound_package_list:",data)
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ console.error('Error:', error);
|
|
|
+ res.end(JSON.stringify({ message:"fail!",data:data,code:data.code}));
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
CMD.get_fq_bound_package_list = function(res,distributorId,app_id){
|
|
|
var secretKey = config.fanqie_config.secretKey;
|
|
|
const postData = {
|
|
@@ -744,7 +858,24 @@ var server = http.createServer(function(req,res){
|
|
|
}else if(jsonData['fun']=="passBackTemplate"&&jsonData['cmd']=="hy_link"){
|
|
|
let is_free = jsonData['data']['is_free']
|
|
|
CMD.get_hy_passBackTemplate(res,is_free)
|
|
|
- }else if(jsonData['fun']=="rechargeTemplate"&&jsonData['cmd']=="fq_link"){
|
|
|
+ }
|
|
|
+ else if(jsonData['fun']=="get_fq_dt_package_list"&&jsonData['cmd']=="fq_dt_link"){
|
|
|
+ let app_type = jsonData['data']['app_type']
|
|
|
+ // let distributor_id = jsonData['data']['distributor_id']
|
|
|
+ CMD.get_fq_dt_package_list(res,config.fanqie_dt_config.distributorId,app_type)
|
|
|
+ }else if(jsonData['fun']=="get_fq_dt_callback_template"&&jsonData['cmd']=="fq_dt_link"){
|
|
|
+ let distributor_id = jsonData['data']['distributor_id']
|
|
|
+ CMD.get_fq_dt_callback_template(res,distributor_id)
|
|
|
+ }else if(jsonData['fun']=="get_fq_dt_rechargeTemplate"&&jsonData['cmd']=="fq_dt_link"){
|
|
|
+ let distributor_id = jsonData['data']['distributor_id']
|
|
|
+ CMD.get_fq_dt_rechargeTemplate(res,distributor_id)
|
|
|
+ }else if(jsonData['fun']=="get_fq_dt_bound_package_list"&&jsonData['cmd']=="fq_dt_link"){
|
|
|
+ let app_id = jsonData['data']['app_id']
|
|
|
+ // let distributor_id = jsonData['data']['distributor_id']
|
|
|
+ CMD.get_fq_dt_bound_package_list(res,config.fanqie_dt_config.distributorId,app_id)
|
|
|
+ }
|
|
|
+
|
|
|
+ else if(jsonData['fun']=="rechargeTemplate"&&jsonData['cmd']=="fq_link"){
|
|
|
let distributor_id = jsonData['data']['distributor_id']
|
|
|
CMD.get_fq_rechargeTemplate(res,distributor_id)
|
|
|
}else if(jsonData['fun']=="get_fq_package_list"&&jsonData['cmd']=="fq_link"){
|