mClass.js 643 Bytes
'use strict';

var logger = global.yoho.logger;
var api = global.yoho.API;
var SearchAPI = global.yoho.SearchAPI;
const helpers = global.yoho.helpers;

class mClass{
    constructor(){
        this.API=api;
        this.SearchAPI=SearchAPI;
        this.logger=logger;
        this.helpers=helpers;
    }

    cb(logs,options){
        return (result)=>{
            if (result && result.code === 200) {
                return result.data;
            } else {
                logger.error(`${logs+JSON.stringify(options)}   接口返回数据错误`);
                return false;
            }
        }
    }
}

module.exports = mClass;