...
|
...
|
@@ -76,10 +76,19 @@ class OptData |
|
|
*/
|
|
|
public static function praiseArticle($udid, $id, $opt = 'ok')
|
|
|
{
|
|
|
$param = Yohobuy::param();
|
|
|
$param['article_id'] = $id;
|
|
|
$param['udid'] = $udid;
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
|
|
|
if ($opt === 'cancel') {
|
|
|
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/praise', 'cancelPraise', array($id, $udid));
|
|
|
// return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/praise', 'cancelPraise', array($id, $udid));
|
|
|
|
|
|
return Yohobuy::get(Yohobuy::SERVICE_URL.'guang/api/v2/praise/cancel', $param);
|
|
|
} else {
|
|
|
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/praise', 'setPraise', array($id, $udid));
|
|
|
// return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/praise', 'setPraise', array($id, $udid));
|
|
|
|
|
|
return Yohobuy::get(Yohobuy::SERVICE_URL.'guang/api/v2/praise/setPraise', $param);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -93,10 +102,19 @@ class OptData |
|
|
*/
|
|
|
public static function collectArticle($uid, $id, $opt = 'ok')
|
|
|
{
|
|
|
$param = Yohobuy::param();
|
|
|
$param['article_id'] = $id;
|
|
|
$param['uid'] = $uid;
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
|
|
|
if ($opt === 'cancel') {
|
|
|
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/favorite/', 'cancelFavorite', array($id, $uid));
|
|
|
// return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/favorite/', 'cancelFavorite', array($id, $uid));
|
|
|
|
|
|
return Yohobuy::get(Yohobuy::SERVICE_URL.'guang/api/v1/favorite/cancelFavorite', $param);
|
|
|
} else {
|
|
|
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/favorite/', 'setFavorite', array($id, $uid));
|
|
|
// return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/favorite/', 'setFavorite', array($id, $uid));
|
|
|
|
|
|
return Yohobuy::get(Yohobuy::SERVICE_URL.'guang/api/v1/favorite/setFavorite', $param);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|