Commit 2099b35c by 庄冰

link

parent b265fa81
...@@ -28,6 +28,20 @@ class TemplatelinkCtl extends CtlBase { ...@@ -28,6 +28,20 @@ class TemplatelinkCtl extends CtlBase {
let result = await this.templatelinkSve.createTemplateLink(pobj); let result = await this.templatelinkSve.createTemplateLink(pobj);
return result; return result;
} }
/**
* 修改投放状态
* @param {*} pobj
*/
async updateLaunchStatus(pobj){
let result = await this.templatelinkSve.updateLaunchStatus(pobj);
return result;
}
async delete(pobj, qobj, req) {
const up = await this.templatelinkSve.deleteTemplateLink(pobj);
return system.getResult(up);
}
} }
module.exports = TemplatelinkCtl; module.exports = TemplatelinkCtl;
...@@ -205,8 +205,7 @@ class TemplatelinkService extends ServiceBase { ...@@ -205,8 +205,7 @@ class TemplatelinkService extends ServiceBase {
* @param {*} pobj * @param {*} pobj
*/ */
async updateLaunchStatus(pobj){ async updateLaunchStatus(pobj){
var ab = pobj.actionBody; var ab = pobj;
var xctx = pobj.xctx;
if(!ab){ if(!ab){
return system.getResultFail(-100,"参数错误"); return system.getResultFail(-100,"参数错误");
} }
...@@ -233,16 +232,15 @@ class TemplatelinkService extends ServiceBase { ...@@ -233,16 +232,15 @@ class TemplatelinkService extends ServiceBase {
* @param {*} pobj * @param {*} pobj
*/ */
async deleteTemplateLink(pobj){ async deleteTemplateLink(pobj){
var ab = pobj.actionBody; var ab = pobj;
var xctx = pobj.xctx;
if(!ab){ if(!ab){
return system.getResultFail(-100,"参数错误"); return system.getResultFail(-100,"参数错误");
} }
if(!ab.code){ if(!ab.id){
return system.getResultFail(-101,"链接编码不能为空"); return system.getResultFail(-101,"链接编码不能为空");
} }
var linkinfo = await this.dao.model.findOne({ var linkinfo = await this.dao.model.findOne({
where:{code:ab.code},raw:true where:{id:ab.id},raw:true
}); });
if(!linkinfo || !linkinfo.id){ if(!linkinfo || !linkinfo.id){
return system.getResultFail(-300,"未知模板链接"); return system.getResultFail(-300,"未知模板链接");
......
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