<?php

use Webman\Route;
use app\controller;

Route::group('/api', function () {
    Route::any('/file', [controller\UploadController::class, 'image'])->middleware([
        \app\middleware\UserToken::class
    ]);
    Route::any('/base_file.html', [controller\UploadController::class, 'base_file'])->middleware([
        \app\middleware\UserToken::class
    ]);
    /** 地址管理 */
    Route::group('/address', function () {
        Route::any('.html', [controller\AddressController::class, 'index'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);
        Route::any('/add.html', [controller\AddressController::class, 'add'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);

        Route::any('/del.html', [controller\AddressController::class, 'del'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);
    });
    Route::group('/login', function () {
        /** -----登录 */
        Route::any('/login.html', [controller\LoginController::class, 'login'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\Decrypt::class
        ]);

        /** ----注册 */
        Route::any('/register.html', [controller\LoginController::class, 'register'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\Decrypt::class
        ]);
//        /** 。。。。。注册领奖 */
//        Route::any('/register_receive.html', [controller\LoginController::class, 'register_receive'])->middleware([
//            //\app\middleware\Sign::class
//            \app\middleware\UserToken::class
//        ]);
        /** 是否实名 */
        Route::any('/sign_in.html', [controller\LoginController::class, 'signIn'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\Decrypt::class
        ]);
        /** 未登修改密码 */
        Route::any('/passsave.html', [controller\LoginController::class, 'passsave'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\Decrypt::class
        ]);
        /** 验证码 */
        Route::any('/authccode.html', [controller\LoginController::class, 'authccode'])->middleware([
            // \app\middleware\Sign::class,
            \app\middleware\Decrypt::class
        ]);

        /** 。。。。。邀请规则 */
        Route::any('/invite.html', [controller\LoginController::class, 'invite'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);
//            /** 。。。。。邀请领奖 */
//            Route::any('/invite_receive.html', [controller\LoginController::class, 'invite_receive'])->middleware([
//                \app\middleware\Sign::class,
//                \app\middleware\UserToken::class,
//                \app\middleware\Decrypt::class
//            ]);


    });

    /**  。。。。配置信息+新闻新闻*/
    Route::group('/config', function () {
        /** 首页配置 */
        Route::any('/data.html', [controller\ConfigController::class, 'data'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\Decrypt::class
        ]);
        /** 新闻列表 */
        Route::any('/article.html', [controller\ConfigController::class, 'article'])->middleware([
//                \app\middleware\Sign::class,
\app\middleware\Decrypt::class
        ]);
        /** 新闻详情 */
        Route::any('/articledetails.html', [controller\ConfigController::class, 'articleDetails'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\Decrypt::class
        ]);
        /** 支付配置 */
        Route::any('/pay_aisle.html', [controller\ConfigController::class, 'payAisle'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\Decrypt::class
        ]);

    });

//        Route::group('/raffle', function () {
//            /** ----抽奖产品列表 */
//            Route::any('.html', [controller\RaffleController::class, 'index'])->middleware([
//                \app\middleware\Sign::class,
//                \app\middleware\UserToken::class,
//                \app\middleware\Decrypt::class
//            ]);
//            /** ----抽奖 */
//            Route::any('/buy.html', [controller\RaffleController::class, 'buy'])->middleware([
//                \app\middleware\Sign::class,
//                \app\middleware\UserToken::class,
//                \app\middleware\Decrypt::class
//            ]);
//        });

    /** 产品 */
    Route::group('/goods', function () {
        /** -----项目 */
        Route::any('/charity.html', [controller\GoodsController::class, 'charity'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\Decrypt::class,
            \app\middleware\UserToken::class,
        ]);
        /** -----购买 */
        Route::any('/charity_buy.html', [controller\GoodsController::class, 'charityBuy'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);
        /** -----线下支付凭证*/
        Route::any('/voucher_add.html', [controller\GoodsController::class, 'voucher_add'])->middleware([
//                \app\middleware\Sign::class,
\app\middleware\UserToken::class,
//                \app\middleware\Decrypt::class/
        ]);

        /** -----已经购买恢复 */
        Route::any('/buy_restore.html', [controller\GoodsController::class, 'restore'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);

//            /** -----兑换商品列表*/
//            Route::any('/exchange_goods.html', [controller\GoodsController::class, 'exchangeGoods'])->middleware([
//                \app\middleware\Sign::class,
//                \app\middleware\UserToken::class,
//                \app\middleware\Decrypt::class
//            ]);
        /** -----申领邮寄*/
        Route::any('/exchange.html', [controller\GoodsController::class, 'exchange'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);
        /** -----我的卡包*/
        Route::any('/exchange_list.html', [controller\GoodsController::class, 'exchangeList'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);

        /** -----保价支付 */
        Route::any('/exchange_buy.html', [controller\GoodsController::class, 'exchangeBuy'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);

        /** -----预存激活支付 */
        Route::any('/prestore_buy.html', [controller\GoodsController::class, 'prestoreBuy'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class

        ]);
        /** -----资产险支付 */
        Route::any('/pay_buy.html', [controller\GoodsController::class, 'payBuy'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class

        ]);
        /** -----芯片升级支付 */
        Route::any('/upgrade_pay_buy.html', [controller\GoodsController::class, 'upgrade_pay_buy'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class

        ]);

//            /** -----补偿申请*/
//            Route::any('/compensation_add.html', [controller\GoodsController::class, 'compensationAdd'])->middleware([
//                //\app\middleware\Sign::class,
//                \app\middleware\UserToken::class
//            ]);
//            /** -----补偿申请-详情*/
//            Route::any('/compensation_details.html', [controller\GoodsController::class, 'compensationDetails'])->middleware([
//                //\app\middleware\Sign::class,
//                \app\middleware\UserToken::class
//            ]);


    });
    /** 银行卡管理 */
    Route::group('/card', function () {
//            /** 。。。。。领取银行卡卡 */
//            Route::any('/receive_card.html', [controller\BankCardController::class, 'receiveCard'])->middleware([
//                \app\middleware\Sign::class,
//                \app\middleware\UserToken::class,
//                \app\middleware\Decrypt::class
//            ]);
//            /** 。。。。。银行卡详情 */
//            Route::any('/card_details.html', [controller\BankCardController::class, 'cardDetails'])->middleware([
//                \app\middleware\Sign::class,
//                \app\middleware\UserToken::class,
//                \app\middleware\Decrypt::class
//            ]);
//            /** 。。。。。银行卡地址编辑 */
//            Route::any('/card_address.html', [controller\BankCardController::class, 'cardAddress'])->middleware([
//                \app\middleware\Sign::class,
//                \app\middleware\UserToken::class,
//                \app\middleware\Decrypt::class
//            ]);
        /** 。。。。。银行卡支付密码设置 */
        Route::any('/card_pass.html', [controller\BankCardController::class, 'cardPass'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);

        /** 。。。。。领取银行卡卡 */
        Route::any('/system.html', [controller\BankCardController::class, 'system'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);

    });

    /** 流水 */
    Route::group('/stream', function () {
        /** 。。。。。资金流水 */
        Route::any('.html', [controller\StreamController::class, 'data'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);
        /** 。。。。。钱包类型 */
        Route::any('/mold_type.html', [controller\StreamController::class, 'moldType'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\Decrypt::class
        ]);
    });

    /** 提现 */
    Route::group('/withdraw', function () {
        /** 。。。。。申请提现 */
        Route::any('.html', [controller\WithdrawController::class, 'applyfor'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);
        /** 。。。。。。提现记录 */
        Route::any('/stream.html', [controller\WithdrawController::class, 'stream'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);

    });

    /** 绑定 */
    Route::group('/binding', function () {
        /** ······绑定 */
        Route::any('.html', [controller\BindingController::class, 'addbinding'])->middleware([
//            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
//            \app\middleware\Decrypt::class
        ]);
        Route::any('/binding_new.html', [controller\BindingController::class, 'addbinding_new'])->middleware([
//            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);
        /** ······绑定记录 */
        Route::any('/binding_details.html', [controller\BindingController::class, 'binding_details'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);

    });

    /** 还款 */
//        Route::group('/repayment', function () {
//            /** 还款 */
//            Route::any('.html', [controller\RepaymenController::class, 'applyfor'])->middleware([
//                \app\middleware\Sign::class,
//                \app\middleware\UserToken::class,
//                \app\middleware\Decrypt::class
//            ]);
//            /** 还款记录 */
//            Route::any('/stream.html', [controller\RepaymenController::class, 'stream'])->middleware([
//                \app\middleware\UserToken::class,
//                \app\middleware\Decrypt::class
//
//            ]);
//        });


    /** 会员 */
    Route::group('/user', function () {
        /** 修改地址 */
        Route::any('/mygoods_saveaddress.html', [controller\AddressController::class, 'mygoods_saveaddress'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);
        /** 退出登录 */
        Route::any('/quit.html', [controller\UserController::class, 'quit'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);

        /** 。。。。。修改密码 */
        Route::any('/save.html', [controller\UserController::class, 'save'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);
        /** 。。。。。会员信息 */
        Route::any('.html', [controller\UserController::class, 'userData'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);


        /** 。。。。。投资记录 */
        Route::any('/mygoods.html', [controller\MyGoodsController::class, 'index'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);
//            /** 。。。。。发货记录列表 */
//            Route::any('/deliverygoods.html', [controller\MyGoodsController::class, 'deliverygoods'])->middleware([
//                \app\middleware\Sign::class,
//                \app\middleware\UserToken::class,
//                \app\middleware\Decrypt::class
//            ]);

        /** ------签到列表 */
        Route::any('/signlist.html', [controller\UserController::class, 'signlist'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);
        /** -----签到 */
        Route::any('/sign.html', [controller\UserController::class, 'sign'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);
        /**。。。。。实名*/
        Route::any('/identity.html', [controller\UserIdentityController::class, 'Updata'])->middleware([
            //\app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);
        /**。。。。。银行卡 */
        Route::any('/bank_card.html', [controller\BankCardController::class, 'Updata'])->middleware([
            //\app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);
        /** 。。。。。。我的团队头数据 */
        Route::any('/team.html', [controller\UserController::class, 'team'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);
        /** 。。。。。我的团队列表数据 */
        Route::any('/team_list.html', [controller\UserController::class, 'teamList'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);

        /** 动态密码 */
        Route::any('/dynamic_pass.html', [controller\UserController::class, 'dynamic_pass'])->middleware([
            \app\middleware\Sign::class,
            \app\middleware\UserToken::class,
            \app\middleware\Decrypt::class
        ]);
    });
    /** 拉丁支付回调 */
    Route::group('/pay', function () {
        Route::any('/payment_callback.html', [controller\PayController::class, 'paymentCallback']);
        Route::any('/payment_callback_two.html', [controller\PayController::class, 'paymentCallbackTwo']);
        Route::any('/payment_callback_three.html', [controller\PayController::class, 'paymentCallbackThree']);
        Route::any('/payment_callback_five.html', [controller\PayController::class, 'payment_callback_five']);
    });

    /** 下发回调 */
    Route::any('/issue.html', [controller\IssueController::class, 'index']);

});
