favorite-api.js 664 Bytes
const library = '../../../library';
const API = require(`${library}/api`).API;
const ServiceAPI = require(`${library}/api`).ServiceAPI;
const sign = require(`${library}/sign`);
const api = new API();
const serviceAPI = new ServiceAPI();

module.exports.getUidProductFavAsync = function(uid, pid, isUrl) {
    isUrl;
    return api.get('', sign.apiSign({
        method: 'app.favorite.isFavorite',
        id: pid,
        uid: uid,
        type: 'product'
    }));
};

module.exports.isFavoriteBrandAsync = function(uid, bid) {
    return serviceAPI.get('shops/service/v1/favorite/getUidBrandFav', sign.apiSign({
        uid: uid,
        brandId: bid
    }));
};