<?php

use App\Http\Controllers\H5\CollaboratorsController;
use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\H5\AuthController;
use App\Http\Controllers\H5\PartnerWalletsController;
use App\Http\Controllers\H5\PartnerWithdrawalsController;
use App\Http\Controllers\H5\ServiceUserController;
use App\Http\Controllers\H5\PartnerController;
use App\Http\Controllers\H5\IssueController;
use App\Http\Controllers\H5\UploadController;
use App\Http\Controllers\H5\WechatController;
use App\Http\Controllers\H5\CommentController;
use App\Http\Controllers\H5\OrderController;
use App\Http\Controllers\H5\SurveyController;
use App\Http\Controllers\H5\UserController;
use App\Http\Controllers\H5\FatController;
use App\Http\Controllers\H5\UserInfoController;
use App\Http\Controllers\H5\GuideController;
use App\Http\Controllers\H5\ReappraiseController;
use App\Http\Controllers\H5\FoodController;
use App\Http\Controllers\H5\ModeratorController;
use App\Http\Controllers\H5\OfflineOrderController;
use App\Http\Controllers\H5\WorkOrderController;
use App\Http\Controllers\H5\OfficeController;
use App\Http\Controllers\H5\RestaurantController;
use App\Http\Controllers\H5\ShopController;
use App\Http\Controllers\H5\LotteryController;
use App\Http\Controllers\H5\OtherController;
use App\Http\Controllers\H5\ActivityController;
use App\Http\Controllers\H5\VideoController;

//上传图片
Route::post('upload/image', [UploadController::class, 'uploadImage'])->name("h5.upload.image");
//合作伙伴授权
Route::get('partner/official/auth', [WechatController::class, "partnerAuth"])->name('partner.official.auth');
//副教练授权
Route::get('coach/official/auth', [WechatController::class, "coachAuth"])->name('coach.official.auth');
//财务授权
Route::get('finance/official/auth', [WechatController::class, "financeAuth"])->name('finance.official.auth');
//H5授权
Route::get('wechat/user/auth', [WechatController::class, 'wechatAuth'])->name('h5.official.auth');
//财务绑定
Route::get('finance', [AuthController::class, "finance"])->name('h5.finance.auth');
// 新非静默授权
Route::get('newNonSilenceAuth', [WechatController::class, "newNonSilenceAuth"])->name('h5.silence.auth');
/**
 * 订单备注
 */
//备注授权
Route::get('order/comments/work/auth', [WechatController::class, 'workOrderCommentsAuth'])->name('order.comments.work.auth');
Route::get('order/bound/enterprise/auth', [WechatController::class, 'workOrderBoundEnterprise'])->name('order.bound.enterprise.auth');
Route::get('order/bound/enterprise/auth/v2', [WechatController::class, 'workOrderBoundEnterpriseV2'])->name('order.bound.enterprise.auth.v2');
Route::get('invite/auth', [WechatController::class, 'workInvite'])->name('work.invite.auth');
Route::get('view/invite/auth', [WechatController::class, 'workViewInvite'])->name('work.view.invite.auth');

Route::get('talk/auth', [WechatController::class, 'workTalkAuth'])->name('work.talk.auth');
Route::get('add/annual/meeting/auth', [WechatController::class, 'workAddAnnualMeeting'])->name('work.add.annual.meeting.auth');
Route::get('all/annual/meeting/auth', [WechatController::class, 'workAllAnnualMeeting'])->name('work.all.annual.meeting.auth');

//备注列表
Route::get('get/comment/type', [CommentController::class, 'getCommentType'])->name('h5.get.comment.type');
Route::get('order/comments', [CommentController::class, 'orderComments'])->name('h5.order.comments');
//备注
Route::post('comment/orders', [CommentController::class, 'commentOrder'])->name('h5.comment.order');
//删除备注
Route::delete('order/comments/{comment}', [CommentController::class, 'deleteComment'])->name('h5.delete.order.comment');
//修改备注
Route::put('order/comments/{comment}', [CommentController::class, 'updateOrderComment'])->name('h5.update.order.comment');
//备注详情
Route::get('order/comments/{comment}', [CommentController::class, 'orderComment'])->name('h5.order.comment');
//未绑定订单列表
Route::get('no/group/orders', [OrderController::class, 'groupOrders'])->name("h5.group.orders");
//绑定订单与企业微信群
Route::post('bind/work/group/orders/{order}', [OrderController::class, 'bindWorkGroupOrder'])->name('h5.bind.work.group.order');
//解绑订单与企业微信群
Route::post('unbind/work/group/orders', [OrderController::class, 'unbindWorkGroupOrder'])->name('h5.unbind.work.group.order');
//绑定角色
Route::post('order/bind/role', [OrderController::class, 'bindRole'])->name('h5.order.bind..role');

Route::get('send/message', [OrderController::class, 'sendNoticeMsg'])->name('send.message');


//更新订餐状态
//Route::get("/restaurant/update/status", [RestaurantController::class, 'updateRestaurantStatus'])->name('h5.restaurant.update.status');

//错误上报
Route::post('report/error/data', [AuthController::class, 'reportErrorData'])->name('h5.report.error..data');
/**
 * 餐单
 */
//更新旧的餐单没有id的情况
//Route::get('update/user/guides', [GuideController::class, 'updateOldGuides'])->name('h5.update.user.guides');
Route::middleware('check.group')->group(function () {
    //列表
    Route::get('user/guides', [GuideController::class, 'guides'])->name('h5.guides');
    //新增餐单
    Route::post('orders/guide', [GuideController::class, 'addOrderGuide'])->name('h5.add.order.guide');
    //复制餐单
    Route::post('orders/copy/guide', [GuideController::class, 'copyOrderGuide'])->name('h5.copy.order.guide');
    //删除餐单
    Route::delete('orders/guides/{guide}', [GuideController::class, 'deleteOrderGuide'])->name('h5.delete.order.guide')->where('guide', '[0-9]+');
    //修改餐单
    Route::put('guides/{guide}', [GuideController::class, 'updateGuide'])->name("h5.update.guide");
    //订单营养素方案
    Route::get('order/scheme', [GuideController::class, 'orderScheme'])->name("h5.work.order.scheme");
    //获取餐单左侧数据，方案营养素和食物
    Route::get('get/order/food', [GuideController::class, 'getOrderFood'])->name("h5.get.order.food");
    //审核餐单
    Route::put('check/guide', [GuideController::class, 'checkGuide'])->name("h5.check.guide");

    //设置餐单模板
    Route::post('set/guide/template', [GuideController::class, 'setGuideTemplate'])->name('h5.set.order.guide.template');
    //获取餐单模板
    Route::get('get/guide/template', [GuideController::class, 'getGuideTemplate'])->name('h5.get.order.guide.template');
    //审核餐单
    Route::put('check/guide/template', [GuideController::class, 'checkGuideTemplate'])->name('h5.check.order.guide.template');
    //设置餐单
    Route::post('set/user/guide', [GuideController::class, 'setOrderGuide'])->name('h5.set.user.guide.');
    //批量设置餐单
    Route::post('batch/set/user/guide', [GuideController::class, 'batchSetOrderGuide'])->name('h5.batch.set.user.guide');
});
/**
 * 食物内容管理
 */
//列表
Route::get('foods', [FoodController::class, 'foodList'])->name('h5.foods');
Route::post('wechat/work/login', [AuthController::class, 'wechatWorkLogin'])->name('h5.wechat.work.login');

/*
 * 小程序分包使用，不验证登录态
 */
Route::get('get/fat/kinds/v1', [FatController::class, 'getFatKindsV1'])->name('h5.get.fat.kinds.v1');
Route::get('get/fat/stat/v1', [FatController::class, 'getFatStatV1'])->name('h5.get.fat.stat.v1');

//企业微信授权检测
Route::middleware(['auth:api', 'auth.work'])->group(function () {

    //企业微信对应订单服务人员列表
    Route::get('work/group/roles', [ServiceUserController::class, 'workGroupRoles']);
    //企业微信群检测
    Route::middleware('check.group')->group(function () {
        /**
         * 订单复评
         */
        //其他角色列表
        Route::get('order/other/roles', [ReappraiseController::class, 'otherRoles'])->name("h5.other.roles");

        /**
         * 图表信息
         */
        //图标数据
        Route::get('user/fat/kinds', [FatController::class, 'fatKinds'])->name('h5.fat.kinds');
        //图表统计
        Route::get('user/fat/stat', [FatController::class, 'fatStat'])->name('h5.fat.stat');
        //图标数据
        Route::get('user/health/kinds', [FatController::class, 'healthKinds'])->name('h5.health.kinds');
        //图表统计
        Route::get('user/health/stat', [FatController::class, 'healthStat'])->name('h5.health.stat');

        //重构后数据
        //图标数据
        Route::get('get/fat/kinds', [FatController::class, 'getFatKinds'])->name('h5.get.fat.kinds');
        //图表统计
        Route::get('get/fat/stat', [FatController::class, 'getFatStat'])->name('h5.get.fat.stat');
        //体脂记录
        Route::get('get/fat/logs', [FatController::class, 'getFatLogList'])->name('h5.get.fat.log.list');
        //体脂详情
        Route::get('get/fat/log/detail', [FatController::class, 'getFatDetail'])->name('h5.get.fat.log.detail');
        //比较体脂
        Route::post('compare/fat/logs', [FatController::class, 'comparefatLogs'])->name('h5.compare.fat.logs');

        /**
         * 订单用户信息
         */
        //用户信息
        Route::get('order/user/health/info', [UserController::class, 'healthInfo'])->name('h5.user.health.info');
        // 删除身体照
        Route::delete('delete/order/body/images', [UserController::class, 'deleteBodyImages'])->name('h5.delete.body.images');
        // 删除方案后的身体照
        Route::delete('delete/order/after/body/images', [UserController::class, 'deleteAfterBodyImages'])->name('h5.delete.after.body.images');
        //用户报告
        Route::get('order/user/health/report', [UserController::class, 'healthReport'])->name("h5.user.health.report");
        //体脂记录
        Route::get('order/fat/logs', [FatController::class, 'fatLogs'])->name('h5.fat.logs');
        //体脂详情
        Route::get('order/fat/logs/detail', [FatController::class, 'fatLog'])->name('h5.fat.logs.detail');
        //云康宝体脂记录
        Route::get('order/health/fat/logs', [FatController::class, 'healthFatLogs'])->name('h5.health.fat.logs');
        //云康宝体脂详情
        Route::get('order/health/fat/logs/detail', [FatController::class, 'healthFatLog'])->name('h5.health.fat.logs.detail');
        //服务状态
        Route::get('user/service/status', [UserInfoController::class, 'serviceStatus'])->name("h5.service.status");
        //修改用户信息
        Route::put('order/user/health/info', [UserInfoController::class, 'updateHealthInfo'])->name('h5.update.user.health.info');
        //增加用户报告
        Route::post('order/user/health/report', [UserController::class, 'storeHealthReport'])->name('h5.store.user.health.report');
        //删除用户报告
        Route::delete('order/user/health/reports/{report}', [UserController::class, 'deleteHealthReport'])->name('h5.delete.user.health.report');
        //标记用户状态
        Route::post('mark/order/status', [OrderController::class, 'updateServerStatus'])->name('h5.mark.order.status');
        //标记订单状态
        Route::post('mark/user/order/status', [OrderController::class, 'updateOrderStatus'])->name('h5.mark.user.order.status');
        //用户内部服务状态
        Route::get('order/user/service/status', [UserController::class, 'userServiceStatus'])->name('h5.user.service.status');

        //添加快递单号
        Route::post('order/update/delivery', [OrderController::class, 'updateDeliveryInfo'])->name('h5.order.add.delivery');

        //添加补充资料
        Route::post('add/other/health/file', [UserController::class, 'addOtherHealthFile'])->name('h5.add.other.health.file');
        //获取补充列表
        Route::get('get/other/health/list', [UserController::class, 'getOtherHealthReport'])->name('h5.get.other.health.list');
        //获取补充资料详情
        Route::get('get/other/health/detail', [UserController::class, 'getOtherHealthFileDetail'])->name('h5.get.other.health.detail');
        //删除补充资料
        Route::delete('delete/other/health/file', [UserController::class, 'deleteOtherHealthFile'])->name('h5.delete.user.other.health.file');

        //添加工单
        Route::post('add/work/order', [WorkOrderController::class, 'addWorkOrder'])->name('h5.add.work.order');
        //获取工单列表
        Route::get('get/work/order', [WorkOrderController::class, 'getWorkOrderList'])->name('h5.get.work.order');
        //撤销工单
        Route::put('update/work/order', [WorkOrderController::class, 'updateWorkOrder'])->name('h5.update.work.order');
        //获取工单详情
        Route::get('get/work/order/detail', [WorkOrderController::class, 'getWorkOrderDetail'])->name('h5.get.work.order.detail');

        //进群获取信息
        Route::get('get/chat/info', [OrderController::class, 'getChatInfo'])->name('h5.get.chat.info');
    });


    /**
     * 订单复评
     */
    //教练复盘评估
    Route::post('reappraise/roles/{role_order}', [ReappraiseController::class, 'reappraiseRole'])->name('h5.reappraise.role')->where('role_order', '[0-9]+');
    //复评详情
    Route::get('roles/{role_order}/reappraise', [ReappraiseController::class, 'roleReappraise'])->name('h5.role.reappraise')->where('role_order', '[0-9]+');
    //复评
    Route::post('reappraise/roles/{role_order}/v2', [ReappraiseController::class, 'reappraiseRoleV2'])->name('h5.reappraise.role.V2')->where('role_order', '[0-9]+');
    //企业微信绑定服务人员
    Route::post('bind/work/service/user', [ServiceUserController::class, 'bindWorkServiceUser'])->name('h5.bind.work.service.user');

    //更改订单用户
    Route::post('orders/update/user', [OrderController::class, 'updateOrderUser'])->name('h5.order.update.user');
    /**
     * 已绑定服务人员
     */
    Route::middleware('check.servicer')->group(function () {
        //增加线下订单
        Route::post('offline/order', [OfflineOrderController::class, 'store'])->name('h5.store.offline.order');
    });

    /**
     * 头脑风暴
     */
    Route::get('get/talk/list', [OtherController::class, 'getTalkList'])->name("work.get.talk.list");
    Route::post('comment/talk/{id}', [OtherController::class, 'commentTalk'])->name('work.comment.talk');
    Route::post('click/star/{id}', [OtherController::class, 'clickStar'])->name('work.click.star');
    Route::get('get/talk/comment/{id}', [OtherController::class, 'getTalkComment'])->name('work.get.talk.comment');
    Route::get('/get/talk/detail/{id}', [OtherController::class, 'getTalkDetail'])->name('work.get.talk.detail');
    Route::post('/browse/talk/{id}', [OtherController::class, 'browseTalk'])->name('work.browse.talk');
    Route::delete('/delete/talk/comment/{id}', [OtherController::class, 'deleteTalkComment'])->name('work.delete.talk.comment');
    //更新用户信息
    Route::put('/update/user/info', [OtherController::class, 'updateUserInfo'])->name('work.update.user.info');
});

/**
 * 订单问卷调查
 */
//问卷调查列表
Route::get('surveys', [SurveyController::class, 'surveys'])->name('h5.surveys');
//问卷调查内容
Route::get('order/surveys/{survey}', [SurveyController::class, 'orderSurvey'])->name('h5.order.survey')->where('survey', '[0-9]+');
//提交问卷调查
Route::post('order/survey/{survey}', [SurveyController::class, 'addOrderSurvey'])->name('h5.add.order.survey')->where('survey', '[0-9]+');
Route::post('send/survey/to/group', [SurveyController::class, 'sendSurveyToGroup'])->name('h5.send.survey.to.group');
Route::post('send/im/chat/msg', [SurveyController::class, 'sendImChatMsg'])->name('h5.send.im.chat.msg');
//是否已绑定
Route::get('work/{chat_id}/group/orders/status', [OrderController::class, 'workGroupOrderStatus'])->name('h5.work.group.order.status');

/**
 * 企业微信用户和后台用
 */
//授权
Route::get('user/work/auth', [WechatController::class, 'userWorkAuth'])->name('user.work.auth');
//绑定用户
Route::post('bind/work/user', [WechatController::class, 'bindWorkUser'])->name('bind.work.user');
//用户详情
Route::get('bind/work/user', [WechatController::class, 'bindWorkUserInfo'])->name('bind.work.user.info');

//企业微信js配置
Route::any('work/js/sdk/config', [WechatController::class, 'workJsSdkConfig'])->name("work.js.sdk.config");
Route::any('work/js/sdk/config/v2', [WechatController::class, 'workJsSdkConfigV2'])->name("work.js.sdk.config.v2");
Route::any('work/js/sdk/config/v3', [WechatController::class, 'workJsSdkConfigV3'])->name("work.js.sdk.config.v3");

/**
 * 小程序url link
 */
Route::get('chat/url/link', [WechatController::class, 'chatUrlLink'])->name("chat.url.link");
Route::post('get/url/link', [WechatController::class, 'getUrlLink'])->name("get.url.link");
Route::post('url/link', [WechatController::class, 'urlLink'])->name("url.link");

/**********************************合伙人 Start********************************************/
//合伙人登录
Route::post('partner/auth', [AuthController::class, 'login'])->name('partner.login');
Route::post('partner/syncUser', [AuthController::class, 'syncUser'])->name('partner.syncUser');

//订单回调
Route::match(['get', 'post'], "notify/restaurant/orders/{trade_no}", [RestaurantController::class, 'notifyOrder'])->name("h5.notify.restaurant.orders");
//退款回调
Route::post("notify/restaurant/orders/refund/{refund_trade_no}", [RestaurantController::class, 'notifyRefund'])->name("h5.notify.restaurant.orders.refund");
//通过订单号获取小票
Route::get("get/order/detail", [RestaurantController::class, 'getOrderDetail'])->name("h5.get.order.detail");

//删除餐饮相关表数据
//Route::delete("delete/restaurant/data", [RestaurantController::class, 'deleteRestaurantData'])->name("h5.delete.restaurant.data");

Route::middleware('auth:api')->group(function (Router $router) {
    //申请合作伙伴
    $router->post('partner', [PartnerController::class, 'storePartner'])->name("h5.store.partner");
    //合作伙伴详情
    $router->get('partner', [PartnerController::class, 'partner'])->name("h5.partner.detail");

    //申请副教练
    $router->post('coach', [PartnerController::class, 'storeCoach'])->name("h5.store.coach");
    //副教练详情
    $router->get("coach", [PartnerController::class, 'coach'])->name("h5.coach.detail");

    //申请服务人员(主教练/副教练/客服)
    $router->post('service_user', [ServiceUserController::class, 'store'])->name("h5.store.service_user");
    //服务人员详情(主教练/副教练/客服)
    $router->get("service_user", [ServiceUserController::class, 'detail'])->name("h5.service_user.detail");
    //获取服务人员信息(介绍人/企业介绍人)
    $router->get('service_user/{service_user_id}', [ServiceUserController::class, "getServiceUserInfo"])->name('h5.service_user.get');
    //服务人员绑定(介绍人/企业介绍人)
    $router->post('service_user/{service_user_id}', [ServiceUserController::class, "bindServiceUser"])->name('h5.service_user.bind');

    //查看用户是否授权service_user
    $router->get("get/user/auth", [WechatController::class, 'getUserIsAuth'])->name("h5.get.user.auth");
    //获取我的客户列表
    $router->get("get/invite/user", [UserController::class, 'getInviteUser'])->name("h5.get.invite.user");
    //更新邀请客户信息
    $router->put("update/invite/user", [UserController::class, 'updateInviteUserInfo'])->name("h5.update.invite.user");
    //预约扫码签到
    $router->post("apply/user/scan/qrcode", [UserController::class, 'applyUserScanQrcode'])->name("h5.apply.user.scan.qrcode");


    //用户问题列表
    $router->get('issue/user', [IssueController::class, 'getIssueUserList'])->name('h5.issue.user');


    //扫码签到
    $router->post("add/scan/user", [UserController::class, 'userScanQrcode'])->name("h5.add.scan.user");
    //获取扫码签到历史记录
    $router->get("get/scan/log", [UserController::class, 'getScanLog'])->name("h5.get.scan.log");
    //获取申请扫码签到记录
    $router->get("get/apply/list", [UserController::class, 'getApplyList'])->name("h5.get.apply.list");
    //取消预约
    $router->delete("delete/apply/log", [UserController::class, 'deleteApplyLog'])->name("h5.delete.apply.log");

    //预定会议室
    $router->post("reserve/meet/room", [OfficeController::class, 'reserveMeetRoom'])->name("h5.reserve.meet.room");
    //获取会议室预定记录
    $router->get("get/reserve/log", [OfficeController::class, 'getReserveLog'])->name("h5.get.reserve.log");
    //获取会议室列表
    $router->get("get/meet/room", [OfficeController::class, 'getMeetRoom'])->name("h5.get.meet.room");
    //取消预定
    $router->put("cancel/reserve", [OfficeController::class, 'cancelReserve'])->name("h5.cancel.reserve");
    //获取办公室
    $router->get("get/office/list", [OfficeController::class, 'getOffice'])->name("h5.get.office.list");

    /**
     * 餐饮功能
     */
    //获取订餐记录
    $router->get("get/restaurant/log", [RestaurantController::class, 'getRestaurantLog'])->name("h5.get.restaurant.log");
    //获取某一天订餐记录
    $router->get("get/restaurant/detail", [RestaurantController::class, 'getRestaurantDetail'])->name("h5.get.restaurant.detail");
    //订餐
    $router->post("add/restaurant", [RestaurantController::class, 'addRestaurant'])->name("h5.add.restaurant");
    //辅助订餐
    $router->post("add/other/restaurant", [RestaurantController::class, 'addOtherRestaurant'])->name("h5.add.other.restaurant");

    //取消订餐
    $router->put("cancel/restaurant", [RestaurantController::class, 'cancelRestaurant'])->name("h5.cancel.restaurant");
    //评价
    $router->put("evaluate/restaurant", [RestaurantController::class, 'evaluate'])->name("h5.evaluate.restaurant");
    //获取厨师做饭安排
//    $router->get("get/chef/plan", [RestaurantController::class, 'getChefCookPlan'])->name("h5.get.chef.plan");
    //获取厨师做饭安排
    $router->get("get/chef/plan", [RestaurantController::class, 'getChefPlan'])->name("h5.get.chef.plan");
    //获取订餐数据统计
    $router->get("get/restaurant/data/stat", [RestaurantController::class, 'getRestaurantDataStat'])->name("get.restaurant.data.stat");
    //获取订餐人员列表
    $router->get("get/day/restaurant/list", [RestaurantController::class, 'getDayRestaurantList'])->name("h5.get.day.restaurant.list");
    //设置订餐提醒
    $router->post("set/restaurant/switch", [RestaurantController::class, 'setRestaurantSwitch'])->name("h5.set.restaurant.switch");
    //扫码取餐
    $router->get("take/restaurant", [RestaurantController::class, 'takeRestaurant'])->name("h5.take.restaurant");

    /**
     * 酒码
     */
    //用户绑定酒码
    Route::post('bind/wine/code', [ShopController::class, 'bindWineCode']);
    Route::get('/wine/code/status', [ShopController::class, 'wineCodeStatus']);
    Route::get('/wine/code/logs', [ShopController::class, 'wineCodeLogs']);
    //发送验证码
    Route::post('send/wine/sms/code', [ShopController::class, 'sendSmsCode']);
    //包装码
    Route::post('/bind/pack/code', [ShopController::class, 'bindPackCode']);
    Route::get('/pack/code/status', [ShopController::class, 'packCodeStatus']);

    Route::post('/bind/user/service', [ServiceUserController::class, 'bindUserService'])->name('h5.bind.user.service');
    Route::get('/get/group', [ServiceUserController::class, 'getGroup'])->name('h5.get.order.group');
});
Route::post('/server/bind/wine/code', [ShopController::class, 'serverBindWineCode']);
Route::get('/server/get/detail', [ShopController::class, 'serverGetDetail']);
Route::get('/server/get/package/list', [ShopController::class, 'serverGetPackList']);
/**
 * 合伙人钱包
 */

Route::prefix('partner/wallets')->middleware('auth:api')->group(function (Router $router) {
    //获取钱包金额
    $router->get('/', [PartnerWalletsController::class, 'show'])->name('partner.wallets');
    //银行卡列表
    $router->get('/accounts', [PartnerWalletsController::class, 'accounts'])->name('partner.wallets.accounts');
    //详情
    $router->get('/account/detail/{id}', [PartnerWalletsController::class, 'getAccountDetail'])->name('partner.wallets.accounts.detail');
    //银行卡添加
    $router->post('/accounts', [PartnerWalletsController::class, 'addAccounts'])->name('partner.wallets.accounts.add');
    //银行卡修改
    $router->put('/accounts/{id}', [PartnerWalletsController::class, 'editAccounts'])->name('partner.wallets.accounts.edit');
    //银行卡删除
    $router->delete('/accounts/{id}', [PartnerWalletsController::class, 'deleteAccounts'])->name('partner.wallets.accounts.delete');
    //设置默认银行卡
    $router->post('/accounts/default/{id}', [PartnerWalletsController::class, 'setDefault'])->name('partner.wallets.accounts.setDefault');
    //获取佣金收益记录
    $router->get('/commission', [PartnerWalletsController::class, 'commissionRecord'])->name('partner.wallets.commissionRecord');
});


/**
 * 合伙人收益提现
 */
Route::prefix('partner/withdrawals')->middleware('auth:api')->group(function (Router $router) {
    //获取提现申请记录
    $router->get('apply', [PartnerWithdrawalsController::class, 'getWithdraws'])->name('partner.withdrawals.getWithdraws');
    //申请提现
    $router->post('apply', [PartnerWithdrawalsController::class, 'apply'])->name('partner.withdrawals.apply');
    //获取账户
    $router->get('account', [PartnerWithdrawalsController::class, 'getAccount'])->name('partner.get.account');
    //上传发票图
    $router->put('update/{id}', [PartnerWithdrawalsController::class, 'updateWithdraw'])->name('partner.withdrawals.update');
    //删除提现记录
    $router->delete('delete/{id}', [PartnerWithdrawalsController::class, 'deleteWithdraw'])->name('partner.withdrawals.delete');
});
/**********************************合伙人 End********************************************/

/**
 * 合作商
 */
Route::prefix('collaborator')->middleware('auth:api')->group(function (Router $router) {
    //获取合作商信息
    $router->get('/', [CollaboratorsController::class, 'detail'])->name('h5.collaborator.detail');
    //修改合作商信息
    $router->post('/', [CollaboratorsController::class, 'store'])->name('h5.collaborator.store');
});

/**
 * 主持人
 */
Route::prefix('moderator')->middleware('auth:api')->group(function () {
    Route::get('/', [ModeratorController::class, 'show'])->name('h5.moderator.detail');
    Route::post('/', [ModeratorController::class, 'store'])->name('h5.moderator.store');
});

/**
 * h5订单管理
 */
Route::prefix('orders')->middleware(['auth:api', 'servicer'])->group(function () {
    //订单列表  是否设置方案
    Route::get('with/scheme', [OrderController::class, 'schemeOrders'])->name('h5,scheme.orders');
    //设置订单方案
    Route::post('/{order}/scheme', [OrderController::class, 'addOrderScheme'])->name('h5.store.order.scheme');
    Route::post('/{order}/save/scheme', [OrderController::class, 'saveOrderScheme'])->name('h5.save.order.scheme');
    //订单方案信息
    Route::get('/{order}/scheme', [OrderController::class, 'orderScheme'])->name('h5.order.scheme');
    //订单用户信息
    Route::get('/{order}/user/health/info', [UserInfoController::class, 'orderHeathInfo'])->name('h5.order.health.info');
    //订单第三步配置
    Route::get('/{order}/step/config', [UserInfoController::class, 'getStepConfig'])->name('h5.order.get.step.config');
    //订单用户报告
    Route::get('/{order}/user/health/reports', [UserInfoController::class, 'orderHealthReports'])->name("h5.order.health.reports");
    //订单补充资料
    Route::get('/{order}/user/other/health/reports', [UserInfoController::class, 'getOtherHealthReport'])->name("h5.order.other.health.reports");
});

/**
 * 活动管理
 */
Route::middleware(['auth:api'])->group(function () {
    //活动列表
    Route::get('activities', [ActivityController::class, 'activities']);
    //活动列表  大会+小会
    Route::get('activities/v2', [ActivityController::class, 'activitiesV2']);
    //小会详情
    Route::get("regular/activities/{activity}", [ActivityController::class, 'regularActivity'])->where('activity', "[0-9]+");
    //报名小会
    Route::post("regular/activities/{activity}", [ActivityController::class, 'applyRegularActivity'])->where('activity', "[0-9]+");
    //活动详情
    Route::get('activities/{activity}', [ActivityController::class, 'activity'])->where('activity', "[0-9]+");
    //活动下单
    Route::post("pay/activities/{activity}", [ActivityController::class, 'payActivity'])->where('activity', "[0-9]+");
    //活动订单列表
    Route::get('activity/orders', [ActivityController::class, 'orders']);
    //活动订单详情
    Route::get('activity/orders/{order}', [ActivityController::class, 'order'])->where('order', "[0-9]+");
    //介绍订单列表
    Route::get('introduce/activity/orders', [ActivityController::class, 'introduceOrders']);
    //分享二维码
    Route::get('activities/{activity}/qrcode', [ActivityController::class, 'introduceQrcode'])->where('activity', "[0-9]+");

    //活动会议菜单
    Route::get("activity/menu/{id}", [ActivityController::class, 'activityMenu']);
    Route::get("activity/menu/detail/{id}", [ActivityController::class, 'meetingMenuDetail']);
    Route::post("activity/meeting/apply/{id}", [ActivityController::class, 'activityMeetingApply']);
    Route::get("activity/desk/number/{id}", [ActivityController::class, 'getMeetingDeskNumber']);

});
Route::put('/check/before/dma/question/{id}', [OrderController::class, 'checkBeforeDmaQuestion'])->name('h5.check.before.dma.question');
//添加签到人员
Route::post("add/activity/import/apply", [ActivityController::class, 'addActivityImportApply']);
Route::get("get/activity/import/apply", [ActivityController::class, 'getActivityImportApply']);
//订单回调
Route::any("activity/order/{trade_no}/callback", [ActivityController::class, 'callbackOrder']);


/**
 * 抽奖管理
 */
//抽奖详情
Route::get('lotteries/{lottery}', [LotteryController::class, 'lottery']);
Route::post('lotteries/{lottery}/awards/{award}', [LotteryController::class, 'lotto']);
Route::post('lotteries/{lottery}/awards/{award}/v2', [LotteryController::class, 'lottoV2']);
//增加名额
Route::post('lotteries/{lottery}/awards/{award}/quotas', [LotteryController::class, 'addQuotas']);

Route::get('lotteries/{lottery}/members', [LotteryController::class, 'members'])->name("h5.lottery.members");
Route::post('lotteries/{lottery}/members', [LotteryController::class, 'storeMembers'])->middleware('auth:api');
Route::get('lotteries/{lottery}/winning/members', [LotteryController::class, 'winningMembers'])->name("h5.lottery.winning.members");


/**
 * 代理管理
 */
Route::middleware('auth:api')->group(function (Router $router) {

    $router->get('agent/shops', [ShopController::class, 'agentShops'])->name('h5.agent.shops');
    $router->get('agent/shops/{shop}', [ShopController::class, 'agentShop'])->name('h5.agent.shop');
    $router->post('pay/agent/shops/{shop}/orders', [ShopController::class, 'payAgentShop']);
    $router->post('pay/agent/shops/{shop}/orders/v2', [ShopController::class, 'payAgentShopV2']);

    $router->get('agent/shop/orders', [ShopController::class, 'agentOrders']);
    $router->get('agent/shop/orders/{order}', [ShopController::class, 'agentOrder']);
    $router->get('agent/shares', [ShopController::class, 'agentShares']);
    //签收
    $router->post('sign/agent/orders/{order}', [ShopController::class, 'signOrder']);

    $router->get('agent/lotto/codes', [ShopController::class, 'agentLottoCodes']);
    $router->post('agent/shop/orders/{order}/stock', [ShopController::class, 'getOutStock']);
    $router->get('agent/info', [ShopController::class, 'agentInfo']);
    $router->get('agent/earning', [ShopController::class, 'agentEarning']);
    $router->get('agent/withdraws', [ShopController::class, 'agentWithdraws']);
    $router->post('agent/withdraw', [ShopController::class, 'agentWithdraw']);
    $router->get('agent/shop/{shop_id}/qrcode', [ShopController::class, 'agentShopQrcode']);
    $router->post('agent/shop/order/callback', [ShopController::class, 'orderCallback']);
    //生成经销商品分享
    $router->post("agent/shops/{shop_id}/share/qrcode", [ShopController::class, 'shopShareQrcode']);
    //注册经销商
    $router->post("agent/users", [ShopController::class, 'storeAgentUsers']);
    $router->post("update/agent/user", [ShopController::class, 'updateAgentUserInfo']);
    //经销商注册验证码
    $router->post('agent/user/code', [ShopController::class, 'agentUserCode']);
    //经销商已购商品列表
    $router->get('user/agent/shops', [ShopController::class, 'userAgentShops']);
    //商品详情
    $router->get('user/agent/shops/{shop_id}', [ShopController::class, 'userAgentShop']);
    //商品提取
    $router->post('agent/shop/{shop_id}/stock', [ShopController::class, 'getOutStockV2']);
    //经销商分享注册信息
    $router->get("agent/share/info", [ShopController::class, 'agentShareInfo']);
    //批发商活动票明细
    $router->get("agent/activity/residue/amount", [ShopController::class, 'residueAmount']);
    //申请退款
    $router->post("apply/residue/amount/refund", [ShopController::class, 'applyRefundAmount']);

});
Route::get("agent/shop/orders/no/{trade_no}", [ShopController::class, 'agentTradeOrder']);
//代理
Route::get('agent/official/auth', [WechatController::class, "agentAuth"])->name('agent.official.auth');
Route::get('member/official/auth', [WechatController::class, "memberAuth"])->name('member.official.auth');
Route::any("agent/order/{trade_no}/callback", [ShopController::class, 'callbackAgentOrder']);

/**
 * 接龙
 */
Route::post('add/connect/dragon', [OtherController::class, 'addConnectDragon'])->name('h5.add.connect.dragon');
Route::get('get/connect/dragon', [OtherController::class, 'getConnectDragon'])->name("h5.get.connect.dragon");
Route::get('get/connect/list', [OtherController::class, 'getConnectList'])->name("h5.get.connect.list");
Route::delete('delete/connect/dragon/{id}', [OtherController::class, 'deleteConnectDragon'])->name("h5.delete.connect.dragon");
Route::get('clear/connect/dragon/table', [OtherController::class, 'clearConnectTable'])->name("h5.clear.connect.dragon");

/**
 * 友福批发商大会
 */
Route::get('invite/auth/v3', [WechatController::class, 'workInviteV3'])->name('work.invite.auth.v3');
Route::get('view/invite/auth/v3', [WechatController::class, 'workViewInviteV3'])->name('work.view.invite.auth.v3');
Route::post('add/invite/user/v3', [OtherController::class, 'addInviteUserV3'])->name('h5.add.invite.user.v3');
Route::get('get/invite/v3', [OtherController::class, 'getInviteV3'])->name("h5.get.invite.v3");
Route::get('get/invite/list/v3', [OtherController::class, 'getInviteListV3'])->name("h5.get.invite.list.v3");
Route::delete('delete/invite/v3/{id}', [OtherController::class, 'deleteInviteV3'])->name("h5.delete.invite.v3");

/**
 * 火锅接龙
 */
Route::get('invite/auth/v2', [WechatController::class, 'workInviteV2'])->name('work.invite.auth.v2');
Route::get('view/invite/auth/v2', [WechatController::class, 'workViewInviteV2'])->name('work.view.invite.auth.v2');
Route::post('add/invite/user/v2', [OtherController::class, 'addInviteUserV2'])->name('h5.add.invite.user.v2');
Route::get('get/invite/v2', [OtherController::class, 'getInviteV2'])->name("h5.get.invite.v2");
Route::get('get/invite/list/v2', [OtherController::class, 'getInviteListV2'])->name("h5.get.invite.list.v2");
Route::delete('delete/invite/v2/{id}', [OtherController::class, 'deleteInviteV2'])->name("h5.delete.invite.v2");

/**
 * 联谊会
 */
Route::get('invite/auth/v4', [WechatController::class, 'workInviteV4'])->name('work.invite.auth.v4');
Route::get('view/invite/auth/v4', [WechatController::class, 'workViewInviteV4'])->name('work.view.invite.auth.v4');
Route::post('add/invite/user/v4', [OtherController::class, 'addInviteUserV4'])->name('h5.add.invite.user.v4');
Route::get('get/invite/v4', [OtherController::class, 'getInviteV4'])->name("h5.get.invite.v4");
Route::get('get/invite/list/v4', [OtherController::class, 'getInviteListV4'])->name("h5.get.invite.list.v4");
Route::delete('delete/invite/v4/{id}', [OtherController::class, 'deleteInviteV4'])->name("h5.delete.invite.v4");
/**
 * 年会 AnnualMeeting
 */
Route::post('add/annual/meeting', [OtherController::class, 'addAnnualMeetingUser'])->name('h5.add.annual.meeting');
Route::get('get/annual/meeting', [OtherController::class, 'getAnnualMeetingUser'])->name("h5.get.annual.meeting");
Route::delete('delete/annual/meeting/{id}', [OtherController::class, 'deleteAnnualMeetingUser'])->name("h5.delete.annual.meeting");
Route::get('clear/annual/meeting/table', [OtherController::class, 'clearConnectTable'])->name("h5.clear.annual.meeting");


//活动订单
Route::get('activities/{id}/orders', [ActivityController::class, 'activityOrders']);
Route::get('get/activity/order/{id}', [ActivityController::class, 'getActivityOrder'])->name("h5.get.activity.order");
/*
 * 视频
 */
Route::get('search/video', [VideoController::class, 'searchVideo'])->name('h5.search.video');
Route::get('get/search/log', [VideoController::class, 'getSearchLog'])->name('h5.get.search.log');
Route::delete('delete/search/log', [VideoController::class, 'delSearchLog'])->name('h5.del.search.log');
Route::get('get/video/list', [VideoController::class, 'getVideoList'])->name('h5.get.video.list');
Route::get('get/video/detail/{id}', [VideoController::class, 'getVideoDetail'])->name('h5.get.video.detail');
Route::post('collect/video', [VideoController::class, 'collectVideo'])->name('h5.collect.video');
Route::get('get/collect/video', [VideoController::class, 'getCollect'])->name('h5.get.collect.video');
Route::post('visitor', [VideoController::class, 'visitor'])->name('h5.video.visitor');
Route::get('get/my/visitor', [VideoController::class, 'getMyVisitor'])->name('h5.get.my.visitor');

//测试活动发送通知
Route::post('send/success/msg', [ActivityController::class, 'sendActivityMsg'])->name('h5.activity.send.success.msg');

//获取活动
Route::get('get/activity', [ActivityController::class, 'getActivity'])->name('h5.get.activity');
//订单生成抽奖码
Route::any("store/orders/{order_no}/lotto/code", [ShopController::class, "storeLottoCode"]);
