123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace App\Http\Controllers\Api\Info;
- use App\Http\Controllers\Controller;
- use App\Services\Info\InformationService;
- use Illuminate\Http\Request;
- /**
- * 新闻咨询
- */
- class InformationController extends Controller
- {
- /**
- * @var InformationService
- */
- private $informationService;
- /**
- * InformationController constructor.
- *
- * @param InformationService $informationService
- */
- public function __construct(InformationService $informationService)
- {
- parent::__construct();
- // $this->middleware('checkUserPermission');
- $this->informationService = $informationService;
- }
- /**
- * 列表
- * @param Request $request
- *
- * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Resources\Json\JsonResource
- * @throws \Prettus\Repository\Exceptions\RepositoryException
- */
- public function index(Request $request)
- {
- $informations = $this->informationService->handleList($request);
- return $this->response->success($informations);
- }
- /**
- * 详情
- * @param Request $request
- * @return \Illuminate\Http\JsonResponse|\Illuminate\Http\Resources\Json\JsonResource
- */
- public function show(Request $request)
- {
- $this->validate($request, ['id' => 'required|integer']);
- $information = $this->informationService->handleProfile($request->get('id'));
- return $this->response->success($information);
- }
- }
|