43 lines
2.0 KiB
PHP
43 lines
2.0 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\Api\GameBalanceController;
|
|
use App\Http\Controllers\Api\LauncherAccountController;
|
|
use App\Http\Controllers\Api\LauncherAuthController;
|
|
use App\Http\Controllers\Api\LauncherController;
|
|
use App\Http\Controllers\Api\LauncherGameTicketController;
|
|
use App\Http\Controllers\Api\LauncherNewsController;
|
|
use App\Http\Controllers\Api\LauncherRealmController;
|
|
use App\Http\Controllers\Api\LauncherRegistrationController;
|
|
use App\Http\Controllers\Api\RobokassaController;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
Route::post('launcher/login', [LauncherAuthController::class, 'login'])
|
|
->middleware('throttle:10,1');
|
|
Route::post('launcher/register', [LauncherRegistrationController::class, 'store'])
|
|
->middleware('throttle:8,1');
|
|
Route::get('launcher/realms', [LauncherRealmController::class, 'index'])
|
|
->middleware('throttle:60,1');
|
|
|
|
Route::middleware('auth:api')->prefix('launcher')->group(function () {
|
|
Route::get('account', [LauncherAccountController::class, 'show']);
|
|
Route::post('game-ticket', [LauncherGameTicketController::class, 'store'])
|
|
->middleware('throttle:10,1');
|
|
Route::get('manifest', [LauncherController::class, 'manifest']);
|
|
Route::get('download/{path}', [LauncherController::class, 'download'])
|
|
->where('path', '.*');
|
|
Route::get('news', [LauncherNewsController::class, 'index']);
|
|
});
|
|
|
|
Route::middleware(['launcher'])->prefix('service')->name('service.')->group(function () {
|
|
Route::post('/update-appcast', [LauncherController::class, 'updateAppcast']);
|
|
});
|
|
|
|
Route::match(['get', 'post'], 'payments/robokassa/result', [RobokassaController::class, 'result'])
|
|
->middleware('throttle:60,1')
|
|
->name('payments.robokassa.result');
|
|
|
|
Route::middleware(['game-server', 'throttle:120,1'])->prefix('game/balance')->group(function (): void {
|
|
Route::get('{accountId}', [GameBalanceController::class, 'show'])->whereNumber('accountId');
|
|
Route::post('{accountId}/spend', [GameBalanceController::class, 'spend'])->whereNumber('accountId');
|
|
});
|