Commit 07f343f6 by 庄冰

getSourceChannelInfo

parent 6c43fe21
......@@ -8,6 +8,7 @@ class Mediaaggregation extends APIBase {
super();
this.needinfoSve = system.getObject("service.media.needinfoSve");
this.mediaaggregationSve = system.getObject("service.mediaaggregation.mediaaggregationSve");
this.launchchannelSve = system.getObject("service.configmag.launchchannelSve");
}
/**
* 接口跳转-POST请求
......@@ -37,6 +38,9 @@ class Mediaaggregation extends APIBase {
case "addbrowsingrecord"://添加页面访问记录
opResult = this.needinfoSve.addbrowsingrecord(pobj);
break;
case "getSourceChannelInfo"://获取来源渠道信息
opResult = this.launchchannelSve.getSourceChannelInfo(pobj);
break;
case "productList"://服务列表
opResult = await this.mediaaggregationSve.productList(pobj);
......
......@@ -71,6 +71,25 @@ class LaunchchannelService extends ServiceBase {
let de = await this.delete(pobj);
return system.getResult(de);
}
//根据渠道编码获取渠道信息(用于媒体聚合页移动端)
async getSourceChannelInfo(pobj){
if(!pobj || !pobj.actionBody){
return system.getResultSuccess(-100,"参数错误");
}
if(!pobj.actionBody.code){
return system.getResultSuccess(-101,"来源渠道编码错误");
}
var channelinfo = await this.dao.model.findOne({
attributes:["code","name"],
where:{code:pobj.actionBody.code},raw:true
});
if(!channelinfo || !channelinfo.code){
return system.getResultFail(-300,"未知渠道")
}
return system.getResultSuccess(channelinfo);
}
}
module.exports = LaunchchannelService;
\ No newline at end of file
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