favorite.js
1.08 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* 我的收藏查询
* @author: jiangfeng<jeff.jiang@yoho.cn>
* @date: 16/7/19
*/
'use strict';
const _ = require('lodash');
const API = global.yoho.API;
const ServiceAPI = global.yoho.ServiceAPI;
const favorite = {
getFavoriteProduct(param) {
let p = {
method: 'web.favorite.product'
};
return API.get('', _.assign(p, param));
},
getFavoriteBrand(param) {
let p = {
method: 'app.favorite.brand'
};
return API.get('', _.assign(p, param));
},
getFavoriteEditoreial(param) {
return ServiceAPI.get('/guang/api/*/favorite/getUserFavArticleList', param);
},
cancelFavorite(uid, ids, type) {
let p = {
method: 'web.favorite.cancel',
uid: uid,
favIds: ids,
type: type
};
return API.post('', p);
},
cancelEditorialFavorite(uid, ids) {
return ServiceAPI.get('/guang/api/*/favorite/cancelFavorite', {
article_id: ids,
uid: uid
});
}
};
module.exports = favorite;