mobile app api

This commit is contained in:
2026-07-27 21:04:07 +03:00
parent 9241e177ac
commit 6913024596
54 changed files with 5156 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
<?php
require __DIR__ . '/_bootstrap.php';
/**
* @OA\Get(
* path="/owners.php",
* tags={"Owners"},
* summary="My owners",
* security={{"bearerAuth":{}}},
* @OA\Response(response=200, description="OK", @OA\JsonContent(
* @OA\Property(property="data", type="array", @OA\Items(ref="#/components/schemas/Owner"))
* )),
* @OA\Response(response=401, ref="#/components/responses/Unauthorized")
* )
*/
require_method('GET');
$user = require_auth($pdo);
$stmt = $pdo->prepare('SELECT * FROM property_owners WHERE user_id = ? ORDER BY owner_id DESC');
$stmt->execute([$user['id']]);
json_data(array_map('present_owner', $stmt->fetchAll()));