favorite-brand-api.js
647 Bytes
'use strict';
const library = '../../../library';
const ServiceAPI = require(`${library}/api`).ServiceAPI;
const sign = require(`${library}/sign`);
const log = require(`${library}/logger`);
const serviceAPI = new ServiceAPI();
module.exports.isFavoriteAsync = function(uid, bid) {
return serviceAPI.get('shops/service/v1/favorite/getUidBrandFav', sign.apiSign({
uid: uid,
brandId: bid
})).catch(log.error);
};
module.exports.changeAsync = function(uid, brandId) {
return serviceAPI.get('guang/service/v2/favorite/toggleBrand', sign.apiSign({
uid: uid,
brand_id: brandId
})).catch(log.error);
};