<?php

use Illuminate\Support\Facades\Route;
use App\Constants\HttpStatus;
use App\Http\Controllers\api\TelegramWebHook;
use App\Http\Controllers\api\Home;
use App\Http\Controllers\api\Issue;
use App\Http\Controllers\api\Pay;
use App\Http\Controllers\api\NewPc;

Route::post("/onMessage", [TelegramWebHook::class, 'handle']);
Route::get("/setWebHook", [Home::class, 'setWebHook']);
Route::get("/getUpdates", [Home::class, 'getUpdates']);
Route::get("/setMenuButton", [Home::class, 'setMenuButton']);
Route::get("/setMyCommands", [Home::class, 'setMyCommands']);
Route::get("/setA", [Home::class, 'setA']);


Route::prefix('/newPc')->group(function () {
    Route::get("/yuanTou", [NewPc::class, 'yuanTou']);
    Route::get("/history", [NewPc::class, 'history']);
    Route::get("/prediction", [NewPc::class, 'prediction']);
    Route::get("/countdown", [NewPc::class, 'countdown']);
    Route::get("/", [NewPc::class, 'index']);
    Route::get("/cao", [NewPc::class, 'cao']);
});

Route::prefix('/issue')->group(function () {
    Route::get("/", [Issue::class, 'index']);
    Route::get("/cao", [Issue::class, 'cao']);
    Route::get("/countdown", [Issue::class, 'countdown']);
    Route::get("/prediction", [Issue::class, 'prediction']);
    Route::get("/history", [Issue::class, 'history']);
    Route::get("/yuanTou", [Issue::class, 'yuanTou']);


});


Route::get('/test', [Home::class, 'test']);
Route::prefix('/pay')->group(function () {
    Route::post("/notify", [Pay::class, 'notifyHandle']);
    Route::post("/harvest", [Pay::class, 'harvestHandle']);
});


Route::fallback(function () {
    return response()->json([
        'code' => HttpStatus::NOT_FOUND,
        'timestamp' => time(),
        'msg' => __('messages.' . HttpStatus::NOT_FOUND),
        'data' => null
    ], 200);
});
























