1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- namespace App\Http\Controllers\V2;
- use App\Http\Controllers\BaseController;
- use App\Repositories\PlatformContentRepository;
- use Illuminate\Http\Request;
- use Illuminate\Support\Facades\Validator;
- /**
- * Created by PhpStorm.
- * User: durong
- * Date: 2019/6/17
- * Time: 下午6:42
- */
- class PlatformContentController extends BaseController
- {
- public function __construct(PlatformContentRepository $platformContentRepository)
- {
- $this->platformContentRepository = $platformContentRepository;
- }
- //平台内容列表
- public function index(Request $request)
- {
- $validator = Validator::make($request->all(), [
- 'id' => 'required|integer',
- ]);
- if ($validator->fails()) {
- return $this->jsonError($validator->errors()->first());
- }
- $platformContent = $this->platformContentRepository->index($request->all());
- return $this->jsonSuccess($platformContent);
- }
- }
|