PlatformContentController.php 1001 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace App\Http\Controllers\V2;
  3. use App\Http\Controllers\BaseController;
  4. use App\Repositories\PlatformContentRepository;
  5. use App\Transformers\PlatformContentTransformer;
  6. use Illuminate\Http\Request;
  7. use League\Fractal\Resource\Collection;
  8. use League\Fractal\Manager;
  9. use League\Fractal\Pagination\IlluminatePaginatorAdapter;
  10. /**
  11. * Created by PhpStorm.
  12. * User: durong
  13. * Date: 2019/6/17
  14. * Time: 下午6:42
  15. */
  16. class PlatformContentController extends BaseController
  17. {
  18. public function __construct(PlatformContentRepository $platformContentRepository)
  19. {
  20. $this->platformContentRepository = $platformContentRepository;
  21. }
  22. //平台内容列表
  23. public function index(Request $request)
  24. {
  25. $platformContent = $this->platformContentRepository->index($request->all());
  26. if ($platformContent){
  27. return $this->jsonSuccess($platformContent);
  28. }else {
  29. return $this->jsonError('没有找到相关平台内容');
  30. }
  31. }
  32. }