Commit 2d7ef743 by zhaoxiqing

gsb

parent da32b3ab
var system = require("../../system")
const md5 = require("MD5");
const logCtl = system.getObject("web.oplogCtl");
const moment = require("moment");
class ChannelApi {
constructor() {
this.channelSve = system.getObject("service.channelSve");
}
//渠道绑定
async bindPlatform(queryobj, qobj, req) {
if(!this.trim(queryobj.platform_id)){
return system.getErrResult2("platform_id不能为空")
}
if(!this.trim(queryobj.channel_id)){
return system.getErrResult2("channel_id不能为空")
}
if(!this.trim(queryobj.platform_channel_id)){
return system.getErrResult2("platform_channel_id不能为空")
}
var result = await this.channelSve.bindPlatform(queryobj);
return result;
}
//绑定渠道推送
async pushbindingchannel(queryobj, qobj, req){
queryobj.begin = moment().subtract(1, 'days').format('YYYY-MM-DD 00:00:00'); /*前一天的时间*/
queryobj.end = moment().subtract(1, 'days').format('YYYY-MM-DD 23:59:59'); /*前一天的时间*/
console.log(queryobj);
var result = await this.channelSve.pushbindingchannel(queryobj);
return result;
}
trim(o) {
if (!o) {
return "";
}
return o.toString().trim();
}
}
module.exports = ChannelApi;
......@@ -38,6 +38,14 @@ class ChannelService extends microService {
return await this.callms("channel", "channelPage", params);
}
async bindPlatform(params){
return await this.callms("channel" , "bindPlatform", params);
}
async pushbindingchannel(params){
return await this.callms("channel" , "pushbindingchannel", params);
}
// 商户api
async merchantInfo(params) {
return await this.callms("channel", "merchantInfo", params);
......
......@@ -262,7 +262,7 @@ class System {
var domain = "http://39.107.234.14";
return {
// 渠道服务
channel: domain + ":3003" + path,
channel: domain2 + ":3003" + path,
}
} else {
// var odomain = "http://123.57.217.203"
......
......@@ -233,3 +233,26 @@
"msg": "success",
"requestid": "8b5299922e314dd7a9c2711a312f1952"
}
3.4 渠道绑定
url: /api/channelApi/bindPlatform
请求参数:
{
"platform_id":"10000", //平台渠道ID
"channel_id":10000, //渠道id
"platform_channel_id":10000 //默认写死 10000
}
返回结果:
{
"status": 0, // 状态码 0成功 其他失败
"msg": "success",
"data": 10002,
"requestid": "26d5cee56dd54d938b46c759a6885a0f"
}
{
"status": -1,
"msg": "platform_id不能为空",
"data": null,
"bizmsg": "empty"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment