Commit 9b08b49d by 庄冰

media

parent d1294bc9
const system=require("../../../system");
const Dao=require("../../dao.base");
class NeedinfoDao extends Dao{
constructor(){
super(Dao.getModelName(NeedinfoDao));
}
// extraWhere(obj,w,qc,linkAttrs){
// w["company_id"]=obj.company_id;
// return w;
// }
}
module.exports=NeedinfoDao;
\ No newline at end of file
......@@ -6,6 +6,7 @@ class NeedinfoService extends ServiceBase {
constructor() {
super("media", ServiceBase.getDaoName(NeedinfoService));
this.launchchannelDao = system.getObject("db.configmag.launchchannelDao");
this.execClient = system.getObject("util.execClient");
}
//提交商机/线索
async submitNeed(pobj){
......@@ -17,7 +18,8 @@ class NeedinfoService extends ServiceBase {
if(res && res.status && res.status<0){
return res;
}
await this.dao.create(res);
var createRes = await this.dao.create(res);
return system.getResultSuccess();
}
......@@ -51,6 +53,31 @@ class NeedinfoService extends ServiceBase {
ab["channel_name"] = channel.name;
return ab;
}
//推送需求至队列
// async pushMediaNeed2Queue(id) {
// try {
// if (!id) {
// return;
// }
// var url = "http://sytxpublic-msgq-service.chaolai/api/queueAction/producer/springBoard";
// var obj = {
// "actionType": "produceData",// Y 功能名称
// "actionBody": {
// "pushUrl": "https://mmc.gongsibao.com/external/action/template/springBoard",// Y 推送地址
// "actionType": "pushMarketplatFormInfo2Fq",// Y 推送地址接收时的功能名称
// "identifyCode": "marketmedia-pushneed2fq",// Y 操作的业务标识
// "messageBody": { // Y 推送的业务消息,必须有一项对象属性值
// "id": id
// }
// }
// };
// // var result = await this.execClient.execPost(obj, url);
// // console.log(JSON.stringify(result), "result....push....");
// } catch (e) {
// console.log(e, "pushMediaNeed2Queue++++++++++++++++++++++++++++++++++++")
// }
// }
}
module.exports = NeedinfoService;
\ 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