...
|
...
|
@@ -2,7 +2,6 @@ |
|
|
|
|
|
namespace LibModels\Wap\Guang;
|
|
|
|
|
|
use Api\Sign;
|
|
|
use Api\Yohobuy;
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -27,7 +26,7 @@ class OptData |
|
|
*/
|
|
|
public static function favoriteBrand($uid, $id, $opt = 'ok')
|
|
|
{
|
|
|
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'shops/service/v1/favorite/', 'toggleBrandFav', array($uid, $id));
|
|
|
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/favorite/', 'toggleBrand', array($uid, $id) );
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -41,48 +40,26 @@ class OptData |
|
|
public static function favoriteProduct($uid, $skn, $opt = 'ok')
|
|
|
{
|
|
|
if ($opt === 'cancel') {
|
|
|
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'shops/service/v1/favorite/', 'addUidProductFav', array($uid, $skn));
|
|
|
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'shops/service/v1/favorite/', 'addUidProductFav', array($uid, $skn) );
|
|
|
} else {
|
|
|
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'shops/service/v1/favorite/', 'delUidProductFav', array($uid, $skn));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 品牌相关资讯点赞/取消赞
|
|
|
*
|
|
|
* @param int $uid 用户ID
|
|
|
* @param int $id 唯一的ID
|
|
|
* @param string $opt 操作(ok:表示确定,cancel:表示取消)
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function praiseBrandArticle($uid, $id, $opt = 'ok')
|
|
|
{
|
|
|
if ($opt === 'cancel') {
|
|
|
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v1/favorite/', 'cancelPraise', array($id, $uid));
|
|
|
} else {
|
|
|
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v1/favorite/', 'setPraise', array($id, $uid));
|
|
|
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'shops/service/v1/favorite/', 'delUidProductFav', array($uid, $skn) );
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 逛资讯点赞/取消赞
|
|
|
*
|
|
|
* @param int $udid 唯一客户端cookie标识
|
|
|
* @param int $udid 唯一客户端标识
|
|
|
* @param int $id 唯一资讯的ID
|
|
|
* @param string $opt 操作(ok:表示确定,cancel:表示取消)
|
|
|
* @return array
|
|
|
*/
|
|
|
public static function praiseArticle($udid, $id, $opt = 'ok')
|
|
|
{
|
|
|
$param = Yohobuy::param();
|
|
|
$param['udid'] = $udid;
|
|
|
$param['article_id'] = $id;
|
|
|
$param['client_secret'] = Sign::getSign($param);
|
|
|
|
|
|
if ($opt === 'cancel') {
|
|
|
return Yohobuy::get(Yohobuy::SERVICE_URL . 'guang/api/v2/praise/setPraise', $param);
|
|
|
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/praise', 'cancelPraise', array($id, $udid) );
|
|
|
} else {
|
|
|
return Yohobuy::get(Yohobuy::SERVICE_URL . 'guang/api/v2/praise/cancel', $param);
|
|
|
return Yohobuy::yarClient(Yohobuy::SERVICE_URL . 'guang/service/v2/praise', 'setPraise', array($id, $udid) );
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|