Skip to content

Commit

Permalink
update: middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
falstack committed Dec 26, 2019
1 parent 3dff354 commit b57eeea
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
28 changes: 14 additions & 14 deletions app/Http/Controllers/WebController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ class WebController extends Controller
{
public function index(Request $request)
{
$ids = Tag
::where('pin_count', '>', 0)
->whereNull('migration_slug')
->whereIn('parent_slug', [
config('app.tag.bangumi'),
config('app.tag.topic'),
config('app.tag.game')
])
->pluck('slug')
->toArray();

$tagRepository = new TagRepository();

$list = $tagRepository->list($ids);
// $ids = Tag
// ::where('pin_count', '>', 0)
// ->whereNull('migration_slug')
// ->whereIn('parent_slug', [
// config('app.tag.bangumi'),
// config('app.tag.topic'),
// config('app.tag.game')
// ])
// ->pluck('slug')
// ->toArray();
//
// $tagRepository = new TagRepository();
//
// $list = $tagRepository->list($ids);

return $this->resOK($list);
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/v1/BangumiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function create(Request $request)

$bangumiSource = new BangumiSource();
$bangumi = $bangumiSource->importBangumi([
'id' => $request->get('source_id'),
'id' => $request->get('id'),
'name' => $request->get('name'),
'alias' => $request->get('alias'),
'intro' => $request->get('intro'),
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/v1/IdolController.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public function create(Request $request)

$bangumiSource = new BangumiSource();
$slug = $bangumiSource->importIdol([
'id' => $request->get('source_id'),
'id' => $request->get('id'),
'name' => $request->get('name'),
'alias' => $request->get('alias'),
'intro' => $request->get('intro'),
Expand Down
6 changes: 6 additions & 0 deletions routes/route-v1.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@
$route->get('patch', 'BangumiController@patch');

$route->get('fetch', 'BangumiController@fetch');
});

$route->group(['middleware' => 'auth'], function () use ($route)
{
$route->post('create', 'BangumiController@create');
});

Expand Down Expand Up @@ -159,7 +162,10 @@
$route->post('update', 'IdolController@update');

$route->get('fetch', 'IdolController@fetch');
});

$route->group(['middleware' => 'auth'], function () use ($route)
{
$route->post('create', 'IdolController@create');
});

Expand Down

0 comments on commit b57eeea

Please sign in to comment.