Authored by 于良

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

@@ -76,10 +76,19 @@ class OptData @@ -76,10 +76,19 @@ class OptData
76 */ 76 */
77 public static function praiseArticle($udid, $id, $opt = 'ok') 77 public static function praiseArticle($udid, $id, $opt = 'ok')
78 { 78 {
  79 + $param = Yohobuy::param();
  80 + $param['article_id'] = $id;
  81 + $param['udid'] = $udid;
  82 + $param['client_secret'] = Sign::getSign($param);
  83 +
79 if ($opt === 'cancel') { 84 if ($opt === 'cancel') {
80 - return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/praise', 'cancelPraise', array($id, $udid)); 85 +// return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/praise', 'cancelPraise', array($id, $udid));
  86 +
  87 + return Yohobuy::get(Yohobuy::SERVICE_URL.'guang/api/v2/praise/cancel', $param);
81 } else { 88 } else {
82 - return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/praise', 'setPraise', array($id, $udid)); 89 +// return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/praise', 'setPraise', array($id, $udid));
  90 +
  91 + return Yohobuy::get(Yohobuy::SERVICE_URL.'guang/api/v2/praise/setPraise', $param);
83 } 92 }
84 } 93 }
85 94
@@ -93,10 +102,19 @@ class OptData @@ -93,10 +102,19 @@ class OptData
93 */ 102 */
94 public static function collectArticle($uid, $id, $opt = 'ok') 103 public static function collectArticle($uid, $id, $opt = 'ok')
95 { 104 {
  105 + $param = Yohobuy::param();
  106 + $param['article_id'] = $id;
  107 + $param['uid'] = $uid;
  108 + $param['client_secret'] = Sign::getSign($param);
  109 +
96 if ($opt === 'cancel') { 110 if ($opt === 'cancel') {
97 - return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/favorite/', 'cancelFavorite', array($id, $uid)); 111 +// return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/favorite/', 'cancelFavorite', array($id, $uid));
  112 +
  113 + return Yohobuy::get(Yohobuy::SERVICE_URL.'guang/api/v1/favorite/cancelFavorite', $param);
98 } else { 114 } else {
99 - return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/favorite/', 'setFavorite', array($id, $uid)); 115 +// return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/favorite/', 'setFavorite', array($id, $uid));
  116 +
  117 + return Yohobuy::get(Yohobuy::SERVICE_URL.'guang/api/v1/favorite/setFavorite', $param);
100 } 118 }
101 } 119 }
102 120
@@ -25,7 +25,7 @@ class OptController extends AbstractAction @@ -25,7 +25,7 @@ class OptController extends AbstractAction
25 do { 25 do {
26 /* 判断是不是AJAX请求 */ 26 /* 判断是不是AJAX请求 */
27 if (!$this->isAjax()) { 27 if (!$this->isAjax()) {
28 - break; 28 +// break;
29 } 29 }
30 30
31 /* 判断参数是否有效 */ 31 /* 判断参数是否有效 */