Authored by 于良

逛资讯点赞、收藏接口升级

... ... @@ -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);
}
}
... ...
... ... @@ -25,7 +25,7 @@ class OptController extends AbstractAction
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax()) {
break;
// break;
}
/* 判断参数是否有效 */
... ...