Refactor CurrencyController to improve method documentation and simplify rate retrieval

- Updated PHPDoc comments for methods to enhance clarity, specifically for `getAllRates`, `getCurrentRates`, `getGoldRates`, `getCurrencyRateByName`, and `getGoldRateByName`.
- Removed commented-out job dispatching code to streamline the `getAllRates` method.
- Adjusted method descriptions to be more concise and focused on their functionality.

These changes enhance the maintainability and readability of the CurrencyController, facilitating better management of financial data.
This commit is contained in:
Ümit Tunç
2025-01-17 23:37:54 +03:00
parent 7bc63d0979
commit ed0ff822ed
+6 -11
View File
@@ -25,18 +25,13 @@ class CurrencyController extends Controller
}
/**
* Retrieves all merged currency rates from a JSON file.
* Retrieves all gold and currency rates
*
* @return \Illuminate\Http\JsonResponse
*/
public function getAllRates()
{
// Job'ı çalıştır
/*
FetchCurrencyRates::dispatchSync();
FetchGoldRates::dispatchSync();
MergeCurrencyAndGoldRates::dispatchSync();
*/
// JSON dosyasından oku
$jsonFile = 'merged/rates.json';
if (Storage::exists($jsonFile)) {
@@ -49,7 +44,7 @@ class CurrencyController extends Controller
}
/**
* Retrieves the current currency rates from a JSON file.
* Retrieves the current currency rates
*
* @return \Illuminate\Http\JsonResponse
*/
@@ -67,7 +62,7 @@ class CurrencyController extends Controller
}
/**
* Retrieves the current gold rates from a JSON file.
* Retrieves the current gold rates
*
* @return \Illuminate\Http\JsonResponse
*/
@@ -85,7 +80,7 @@ class CurrencyController extends Controller
}
/**
* Retrieves the currency rate by its name from a JSON file.
* Retrieves the currency rate by its name
*
* @param string $currencyName
* @return \Illuminate\Http\JsonResponse
@@ -106,7 +101,7 @@ class CurrencyController extends Controller
}
/**
* Retrieves the gold rate by its name from a JSON file.
* Retrieves the gold rate by its name
*
* @param string $goldName
* @return \Illuminate\Http\JsonResponse