Commit c9c873fe authored by 杨培's avatar 杨培

提供获取用论坛帖子信息的接口

parent 85991b8d
......@@ -6,5 +6,7 @@ require __DIR__.'/_init.php';
Thread::setDebug(true);
$thread = Thread::getHotThreads(5);
//$thread = Thread::getHotThreads(5);
$thread = Thread::info(25);
print_r($thread);
\ No newline at end of file
......@@ -18,8 +18,24 @@ class Thread extends Client
return self::call('thread.getHotThreads', compact('num'));
}
/**
* 获取指定用户发表的帖子的数量
* @param int $uid
* @return int
*/
public static function countThreads($uid)
{
return self::call('thread.countThreads', compact('uid'));
}
/**
* 根据帖子ID获取帖子信息
* @param int $tid
* @return array|null
*/
public static function info($tid)
{
return self::call('thread.info', compact('tid'));
}
}
\ 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