...
|
...
|
@@ -4,8 +4,6 @@ |
|
|
* @date: 2016/09/07
|
|
|
*/
|
|
|
'use strict';
|
|
|
const serviceAPI = global.yoho.ServiceAPI;
|
|
|
const api = global.yoho.API;
|
|
|
|
|
|
module.exports = class extends global.yoho.BaseModel {
|
|
|
constructor(ctx) {
|
...
|
...
|
@@ -26,9 +24,17 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
};
|
|
|
|
|
|
if (opt === 'cancel') {
|
|
|
return serviceAPI.get('guang/api/v2/praise/cancel', param);
|
|
|
return this.get({
|
|
|
url: 'guang/api/v2/praise/cancel',
|
|
|
data: param,
|
|
|
api: global.yoho.ServiceAPI
|
|
|
});
|
|
|
} else {
|
|
|
return serviceAPI.get('guang/api/v2/praise/setPraise', param);
|
|
|
return this.get({
|
|
|
url: 'guang/api/v2/praise/setPraise',
|
|
|
data: param,
|
|
|
api: global.yoho.ServiceAPI
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -46,9 +52,17 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
};
|
|
|
|
|
|
if (opt === 'cancel') {
|
|
|
return serviceAPI.get('guang/api/v1/favorite/cancelFavorite', param);
|
|
|
return this.get({
|
|
|
url: 'guang/api/v1/favorite/cancelFavorite',
|
|
|
data: param,
|
|
|
api: global.yoho.ServiceAPI
|
|
|
});
|
|
|
} else {
|
|
|
return serviceAPI.get('guang/api/v1/favorite/setFavorite', param);
|
|
|
return this.get({
|
|
|
url: 'guang/api/v1/favorite/setFavorite',
|
|
|
data: param,
|
|
|
api: global.yoho.ServiceAPI
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -73,9 +87,17 @@ module.exports = class extends global.yoho.BaseModel { |
|
|
|
|
|
|
|
|
if (opt === 'ok') {
|
|
|
return api.get('app.favorite.add', param);
|
|
|
return this.get({
|
|
|
url: 'app.favorite.add',
|
|
|
data: param,
|
|
|
api: global.yoho.API
|
|
|
});
|
|
|
} else {
|
|
|
return api.get('app.favorite.cancel', param);
|
|
|
return this.get({
|
|
|
url: 'app.favorite.cancel',
|
|
|
data: param,
|
|
|
api: global.yoho.API
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
}; |
...
|
...
|
|