增加 固钉
This commit is contained in:
parent
74ea16ed29
commit
fb0510ada9
@ -36,6 +36,15 @@ public function announcements()
|
|||||||
return $this->resp($resp);
|
return $this->resp($resp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function pinned()
|
||||||
|
{
|
||||||
|
$resp = $this->cache(function () {
|
||||||
|
return $this->get('discussions?filter[tag]=pinned&page[offset]=0&sort=-commentCount');
|
||||||
|
});
|
||||||
|
|
||||||
|
return $this->resp($resp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function cache(Closure $callback)
|
public function cache(Closure $callback)
|
||||||
{
|
{
|
||||||
@ -48,7 +57,8 @@ public function cache(Closure $callback)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function resp($data) {
|
public function resp($data)
|
||||||
|
{
|
||||||
$data['base_url'] = $this->baseUrl;
|
$data['base_url'] = $this->baseUrl;
|
||||||
|
|
||||||
return $this->success($data);
|
return $this->success($data);
|
||||||
|
@ -89,6 +89,10 @@
|
|||||||
$router->get('/announcements', [
|
$router->get('/announcements', [
|
||||||
'uses' => 'ForumController@announcements'
|
'uses' => 'ForumController@announcements'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$router->get('/pinned', [
|
||||||
|
'uses' => 'ForumController@pinned'
|
||||||
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
$router->group(['prefix' => 'modules/{module}'], function () use ($router) {
|
$router->group(['prefix' => 'modules/{module}'], function () use ($router) {
|
||||||
|
Loading…
Reference in New Issue
Block a user