const APIBase = require("../../api.base");
const system = require("../../../system");
const settings = require("../../../../config/settings");
/**
 * 用户端调用订单相关接口
 */
class Templatelink extends APIBase {
    constructor() {
        super();
        this.templatelinkSve = system.getObject("service.template.templatelinkSve");
    }
    /**
      * 接口跳转-POST请求
      * action_process  执行的流程
      * action_type     执行的类型
      * action_body     执行的参数
      */
    async springBoard(pobj, qobj, req) {
        if (!pobj.actionType) {
            return system.getResult(null, "actionType参数不能为空");
        }
        var result = await this.opActionProcess(pobj, pobj.actionType, req);
        return result;
    }
    async opActionProcess(pobj, action_type, req) {
        var opResult = null;
        var self = this;
        pobj.xctx = req.xctx;
        switch (action_type) {
            case "test"://测试
                opResult = system.getResultSuccess("测试接口");
                break;
            // case "createTemplateLink"://创建模板链接
            //     opResult = await this.templatelinkSve.createTemplateLink(pobj);
            //     break;
            // case "editTemplateLink"://修改模板链接
            //     opResult = await this.templatelinkSve.editTemplateLink(pobj);
            //     break;
            // case "updateLaunchStatus"://修改投放状态
            //     opResult = await this.templatelinkSve.updateLaunchStatus(pobj);
            //     break;
            // case "findAndCountAll"://链接列表查询
            //     pobj.actionBody.company_id = pobj.company_id;
            //     opResult = await this.templatelinkSve.findAndCountAll(pobj.actionBody);
            //     break;
            // case "findOneByCode"://获取模板链接详情数据
            //     opResult = await this.templatelinkSve.findOneByCode(pobj);
            //     break;
            default:
                opResult = system.getResult(null, "action_type参数错误");
                break;
        }
        return opResult;
    }

}
module.exports = Templatelink;
