<?php

use App\Http\Controllers\api\ActivityReward;
use App\Http\Controllers\api\Fingerprint;
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;
use App\Http\Controllers\api\PcIssue;
use App\Http\Controllers\api\Wallet;

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('/ActivityReward')->group(function () {
    Route::get('/', [ActivityReward::class, 'index']);
    Route::post('/participate', [ActivityReward::class, 'participate']);
    Route::post('/sendPhoneCode', [ActivityReward::class, 'sendPhoneCode']);
    Route::post('/verifyPhone', [ActivityReward::class, 'verifyPhone']);
    Route::get('/rule', [ActivityReward::class, 'rule']);


});


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']);


});

//足球app请求的接口，根据游戏模式返回不同的数据
Route::prefix('/pcissue')->group(function () {
    Route::get("/", [PcIssue::class, 'index']);
    Route::get("/cao", [PcIssue::class, 'cao']);
    Route::get("/countdown", [PcIssue::class, 'countdown']);
    Route::get("/prediction", [PcIssue::class, 'prediction']);
    Route::get("/history", [PcIssue::class, 'history']);
    Route::get("/yuanTou", [PcIssue::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);
});

// 足球app充值提现的接口需要校验 token 的接口
Route::middleware('check.token')->group(function () {
    Route::prefix('/wallet')->group(function () {
        Route::get("/scan", [Wallet::class, 'scan']);
        Route::post("/recharge", [Wallet::class, 'recharge']);
        Route::get("/channel", [Wallet::class, 'getChannel']);
        Route::post("/createPay", [Wallet::class, 'createPay']);
        Route::get("/withdrawChannel", [Wallet::class, 'withdrawChannel']);
        Route::post("/autoPayout", [Wallet::class, 'autoPayout']);
        Route::post("/payout", [Wallet::class, 'payout']);
        Route::post("/withdraw", [Wallet::class, 'withdraw']);
        Route::post("/addBank", [Wallet::class, 'addBank']);
        Route::get("/delBank", [Wallet::class, 'delBank']);
        Route::get("/bankList", [Wallet::class, 'bankList']);

        Route::post("/addAddress", [Wallet::class, 'addAddress']);
        Route::get("/delAddress", [Wallet::class, 'delAddress']);
        Route::get("/address", [Wallet::class, 'address']);
        
        Route::post('/paymentOrder', [Wallet::class, 'paymentOrder']);
        Route::post('/submitImage', [Wallet::class, 'submitImage']);
    });
});























