var APIBase = require("../../api.base");
var system = require("../../../system");
class TestAPI extends APIBase {
    constructor() {
        super();
    }
    async esign(pobj, query, req) {
        // 1. 日志记录
        // 2. 转发bpohhr.gongsibao.com
        // 3. 调用api服务
        // 4.
        // let result = {
        //     code: 1,
        //     message: "success",
        //     shopNum: "",
        //     data: {}
        // };

        // let thirdOrderNo = req.thirdOrderNo || "";
        // let action = req.action == null || req.action == "" || req.action == "undefined" ? "" : req.action;
        // let flowId = req.flowId == null || req.flowId == "" || req.flowId == "undefined" ? "" : req.flowId;
        // if (action == "" || flowId == "") {
        //     result.code = -101;
        //     result.message = "请求参数有误";
        //     return result;
        // }
        try {
            // if (action != "SIGN_FLOW_FINISH" && action != "SIGN_FLOW_UPDATE") {
            //     result.code = -102;
            //     result.message = "action请求参数有误";
            //     return result;
            // }
            // let params = {
            //     flowId: flowId
            // };
            // let contractDetails = await this.utilesignbaoSve.getContractDetails(params, "eSignBaoApplet");
            // if (action == "SIGN_FLOW_UPDATE") {   //5.9.3	签署人签署状态更新通知，e签宝签署状态变化完成后调用（拒签、签署完成）
            //     var signResultStatus = req.signResult == null || req.signResult == "" || req.signResult == "undefined" ? -1 : req.signResult;
            //     if (signResultStatus >= 0) {
            //         // 跟进回调----更新db签署人签署状态
            //         if (thirdOrderNo.indexOf("dk_") == 0) {
            //             this.dkcontractSve.updateCallbackStatus(req);
            //         } else if (thirdOrderNo.indexOf("ent_") == 0) {
            //             this.entcontractSve.updateCallbackStatus(req);
            //         } else {
            //             this.econtractSve.updateCallbackStatus(req);
            //         }
            //         if (signResultStatus == 2) {  //签署人签署完成,调用e签宝归档流程
            //             var archiveProcess = await this.utilesignbaoSve.archiveProcess(params, "eSignBaoApplet");
            //         }
            //     }
            // } else if (action == "SIGN_FLOW_FINISH") {  //5.9.4	签署任务结束通知，由调用【**归档流程**】后回调此回调
            //     var flowStatus = req.flowStatus == null || req.flowStatus == "" || req.flowStatus == "undefined" ? -1 : req.flowStatus;
            //     if (flowStatus >= 0) {
            //         //TODO:跟进回调----更新db签署流程状态
            //     }
            // }
            return result;
        } catch (e) {
            console.log(e.stack);
            // //日志记录
            // logCtl.error({
            //     optitle: "e签宝签署回调异常error",
            //     op: "wxapplet/impl/esignbao/eSignBaoCallback",
            //     content: e.stack,
            //     clientIp: req.clientIp
            // });
        }
    }
    exam() {
        return "";
    }
    classDesc() {
        return {
            groupName: "",
            groupDesc: "",
            name: "",
            desc: "",
            exam: "",
        };
    }
    methodDescs() {
        return [
            {
                methodDesc: "",
                methodName: "",
                paramdescs: [
                    {
                        paramDesc: "",
                        paramName: "",
                        paramType: "",
                        defaultValue: "",
                    }
                ],
                rtnTypeDesc: "",
                rtnType: ""
            }
        ];
    }
}
module.exports = TestAPI;