UserData.js 892 Bytes
'use strict';

const api = global.yoho.API;

const privateKeyList = {
    'android': 'fd4ad5fcfa0de589ef238c0e7331b585',
    'iphone': 'a85bb0674e08986c6b115d5e3a4884fa',
    'ipad': 'ad9fcda2e679cf9229e37feae2cdcf80',
    'web': '0ed29744ed318fd28d2c07985d3ba633',
    'h5': 'fd4ad5fcfa0de589ef238c0e7331b585'
};

const getVIPInfoByUid = (uid)=>{
    let options = {
        method: 'app.passport.vip',
        uid: uid,
        private_key: '0ed29744ed318fd28d2c07985d3ba633'
    };
    return api.get('', options);
};

const getCouponsList = (uid, type, page, limit)=>{
    page = page || 1;
    type = type || 'notuse';
    limit = limit || 10;

    let options = {
        method: 'app.coupons.lists',
        uid: uid,
        type: type,
        page: page,
        limit: limit
    };
    return api.get('', options);
};

module.exports = {
    getVIPInfoByUid,
    getCouponsList
};