1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace App\Http\Controllers\Api\Info;
- use App\Http\Controllers\Controller;
- use App\Services\Info\InformationService;
- use Illuminate\Http\Request;
- /**
- * Information
- */
- 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);
- }
- }
|