first commit
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
abstract class Controller
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Jobs\FetchCurrencyRates;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class CurrencyController extends Controller
|
||||
{
|
||||
public function getCurrentRates()
|
||||
{
|
||||
// Job'ı çalıştır
|
||||
// $data = FetchCurrencyRates::dispatchSync();
|
||||
|
||||
// JSON dosyasından oku
|
||||
if (Storage::exists('currency/today.json')) {
|
||||
return response()->json(
|
||||
json_decode(Storage::get('currency/today.json'), true)
|
||||
);
|
||||
}
|
||||
|
||||
return response()->json(['error' => 'Veri bulunamadı'], 404);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user