Revize b50f8ebd
Přidáno uživatelem Cajova-Houba před téměř 7 roky(ů)
backend/app/Http/Controllers/DeviceController.php | ||
---|---|---|
9 | 9 |
namespace App\Http\Controllers; |
10 | 10 |
|
11 | 11 |
use App\Model\Device; |
12 |
use App\Model\Zarizeni; |
|
12 | 13 |
use Illuminate\Http\Request; |
13 | 14 |
|
14 | 15 |
class DeviceController extends Controller |
... | ... | |
30 | 31 |
$device->street = $address; |
31 | 32 |
$device->town = $address; |
32 | 33 |
|
33 |
return response()->json($device); |
|
34 |
// return response()->json($device); |
|
35 |
return Zarizeni::findByAddressJoinAddress('Česká Kubice', 'Česká Kubice'); |
|
34 | 36 |
} |
35 | 37 |
|
36 | 38 |
/** |
... | ... | |
48 | 50 |
*/ |
49 | 51 |
public function getDeviceById(Request $request, $id) { |
50 | 52 |
|
53 |
return Zarizeni::findByIdJoinAddress($id); |
|
54 |
} |
|
51 | 55 |
|
52 |
$device = new Device(); |
|
53 |
$device->id = $id; |
|
54 |
$device->name = 'device'; |
|
55 |
$device->street = 'street'; |
|
56 |
$device->town = 'town'; |
|
57 |
|
|
58 |
return response()->json($device); |
|
56 |
public function getAll() { |
|
57 |
return Zarizeni::getAllJoinAddress(); |
|
59 | 58 |
} |
60 | 59 |
} |
Také k dispozici: Unified diff
#6638: Vypnuti kontroly cizich klicu v sql script ktery nahrava data. Pridani entit mesto,ulice,zarizeni. Implementace api ktere vraci zarizeni s adresou.