Commit b79baded authored by 夏彬's avatar 夏彬

添加收藏和浏览记录的接口

parent 1c0eecdb
<?php
/**
* Created by PhpStorm.
* User: xiabin
* Date: 06/07/2017
* Time: 1:47 PM
*/
use internalApi\ucenter\Favorite;
require __DIR__ . '/_init.php';
Favorite::setDebug();
$userId = 1;
$title = 1;
$img = 1;
$sourceUrl = 1;
$from = 'xue';
$type = 'course';
$sourceId = 3;
//$result = Favorite::add($userId,$title,$img,$sourceUrl,$from,$type,$sourceId);
//$result = Favorite::delete(2);
$result = Favorite::isFavorite('xue','course',[2,3,4]);
print_r($result);
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: xiabin
* Date: 06/07/2017
* Time: 8:01 PM
*/
namespace internalApi\ucenter;
use internalApi\base\Client;
class BrowsingHistory extends Client
{
public static function add($userId, $title, $img, $sourceUrl, $from, $type, $sourceId)
{
return self::call('browsingHistory.add', compact('userId', 'title', 'img', 'sourceUrl', 'from', 'type', 'sourceId'));
}
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: xiabin
* Date: 06/07/2017
* Time: 1:45 PM
*/
namespace internalApi\ucenter;
use internalApi\base\Client;
class Favorite extends Client
{
public static function add($userId, $title, $img, $sourceUrl, $from, $type, $sourceId)
{
return self::call('favorite.add', compact('userId', 'title', 'img', 'sourceUrl', 'from', 'type', 'sourceId'));
}
public static function delete($from, $type, $sourceId, $userId)
{
return self::call('favorite.delete', compact('from', 'type', 'sourceId', 'userId'));
}
public static function isFavorite($from, $type, $sourceId,$userId)
{
return self::call('favorite.isFavorite', compact('from', 'type', 'sourceId','userId'));
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment