You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- <?php
-
- namespace App\Http\Controllers\Web\Custom\HelloTechno;
-
- use App\Codes\UserRole;
- use App\Exceptions\AppCommonException;
- use App\Http\Controllers\Web\IParam;
- use App\Util\Custom\HelloTechno\API;
- use Illuminate\Http\JsonResponse;
- use Illuminate\Http\Request;
- use Illuminate\Support\Arr;
-
- class ParkingByCodeController extends HelloTechnoController
- {
- public function name(): string
- {
- return "[HelloTechno専用]駐車場情報取得(駐車場管理コード指定)";
- }
-
- public function description(): string
- {
- return "[HelloTechno専用]駐車場情報を取得する(駐車場管理コード指定)";
- }
-
- public function __construct(
- protected ParkingByCodeParam $param,
- ) {
- parent::__construct();
- $this->roleAllow(UserRole::NORMAL_ADMIN);
- }
-
- protected function getParam(): IParam
- {
- return $this->param;
- }
-
- protected function run(Request $request): JsonResponse
- {
- $param = $this->param;
-
- $parking = Arr::first(API::getParkings([
- API::CONDITION_PARKING_MANAGEMENT_CODDE => $param->parkingManagementCode
- ]));
-
- if ($parking === null) {
- throw new AppCommonException("駐車場情報取得不正");
- }
-
- return $this->successResponse($parking);
- }
- }
|