favorite-brand-api.js
845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* Created by TaoHuang on 2016/6/14.
*/
'use strict';
const api = require('./favorite-api');
const serviceApi = global.yoho.ServiceAPI;
const _ = require('lodash');
const isFavoriteAsync = _.partial(api.isFavAsync, _, _, 'brand');
const addFavAsync = _.partial(api.addFavAsync, _, _, 'brand');
const cancelFavAsync = _.partial(api.cancelFavAsync, _, _, 'brand');
const getShopFavNumAsync = (sid) => {
return serviceApi.get('brower/favorite/queryFavoriteCountByShopIds', {
favIds: [sid],
type: 'shop'
});
};
const getBrandIdNumAsync = (bid) => {
return serviceApi.get('brower/favorite/queryBrandFavoriteCountByBrandId', {
brandId: bid,
type: 'brand'
});
};
module.exports = {
isFavoriteAsync,
addFavAsync,
cancelFavAsync,
getShopFavNumAsync,
getBrandIdNumAsync
};