<?php

use think\facade\Route;

/**
 * 优惠卷，砍价，拼团，秒杀 路由
 */
Route::group('marketing', function () {
    //优惠券相关 资源路由
    Route::get('coupon/list', 'v1.marketing.StoreCoupon/index');
    //优惠卷添加
    Route::get('coupon/create/:type', 'v1.marketing.StoreCoupon/create');
    //优惠卷数据添加添加
    Route::post('coupon/save', 'v1.marketing.StoreCoupon/save');
    //优惠卷修改
    Route::delete('coupon/del/:id', 'v1.marketing.StoreCoupon/delete');
    //修改状态
    Route::put('coupon/status/:id', 'v1.marketing.StoreCoupon/status');
    //发布优惠券表单
    Route::get('coupon/issue/:id', 'v1.marketing.StoreCoupon/issue');
    //发布优惠券
    Route::post('coupon/issue/:id', 'v1.marketing.StoreCoupon/update_issue');
    //发送优惠券列表
    Route::get('coupon/grant', 'v1.marketing.StoreCoupon/grant');
    //已发布优惠券列表
    Route::get('coupon/released', 'v1.marketing.StoreCouponIssue/index');
    //已发布优惠券删除
    Route::delete('coupon/released/:id', 'v1.marketing.StoreCouponIssue/delete');
    //已发布优惠券修改状态表单
    Route::get('coupon/released/:id/status', 'v1.marketing.StoreCouponIssue/edit');
    //已发布优惠券修改状态
    Route::put('coupon/released/status/:id', 'v1.marketing.StoreCouponIssue/status');
    //已发布优惠券领取记录
    Route::get('coupon/released/issue_log/:id', 'v1.marketing.StoreCouponIssue/issue_log');
    //会员领取记录
    Route::get('coupon/user', 'v1.marketing.StoreCouponUser/index');
    //发送优惠券
    Route::post('coupon/user/grant', 'v1.marketing.StoreCouponUser/grant');
    //砍价列表
    Route::get('bargain', 'v1.marketing.StoreBargain/index');
    //砍价详情
    Route::get('bargain/:id', 'v1.marketing.StoreBargain/read');
    //保存新增或编辑砍价
    Route::post('bargain/:id', 'v1.marketing.StoreBargain/save');
    //删除砍价
    Route::delete('bargain/:id', 'v1.marketing.StoreBargain/delete');
    //修改砍价状态
    Route::put('bargain/set_status/:id/:status', 'v1.marketing.StoreBargain/set_status');
    //拼团商品列表
    Route::get('combination', 'v1.marketing.StoreCombination/index');
    //拼团统计
    Route::get('combination/statistics', 'v1.marketing.StoreCombination/statistics');
    //拼团导出
    Route::get('combination/export', 'v1.marketing.StoreCombination/save_excel');
    //拼团商品详情
    Route::get('combination/:id', 'v1.marketing.StoreCombination/read');
    //保存新疆或编辑
    Route::post('combination/:id', 'v1.marketing.StoreCombination/save');
    //删除
    Route::delete('combination/:id', 'v1.marketing.StoreCombination/delete');
    //修改拼团状态
    Route::put('combination/set_status/:id/:status', 'v1.marketing.StoreCombination/set_status');
    //拼团列表
    Route::get('combination/combine/list', 'v1.marketing.StoreCombination/combine_list');
    //拼团人列表
    Route::get('combination/order_pink/:id', 'v1.marketing.StoreCombination/order_pink');
    //秒杀列表
    Route::get('seckill', 'v1.marketing.StoreSeckill/index');
    //秒杀时间段列表
    Route::get('seckill/time_list', 'v1.marketing.StoreSeckill/time_list');
    //秒杀导出
    Route::get('seckill/export', 'v1.marketing.StoreSeckill/save_excel');
    //秒杀详情
    Route::get('seckill/:id', 'v1.marketing.StoreSeckill/read');
    //秒杀保存新增或编辑
    Route::post('seckill/:id', 'v1.marketing.StoreSeckill/save');
    //秒杀删除
    Route::delete('seckill/:id', 'v1.marketing.StoreSeckill/delete');
    //修改秒杀状态
    Route::put('seckill/set_status/:id/:status', 'v1.marketing.StoreSeckill/set_status');
    //助力商品列表
    Route::get('assistance', 'v1.marketing.StoreAssistance/index');
    //助力统计
    Route::get('assistance/statistics', 'v1.marketing.StoreAssistance/statistics');
    //助力导出
    Route::get('assistance/export', 'v1.marketing.StoreAssistance/save_excel');
    //助力商品详情
    Route::get('assistance/:id', 'v1.marketing.StoreAssistance/read');
    //保存新增或编辑
    Route::post('assistance/:id', 'v1.marketing.StoreAssistance/save');
    //删除
    Route::delete('assistance/:id', 'v1.marketing.StoreAssistance/delete');
    //修改助力状态
    Route::put('assistance/set_status/:id/:status', 'v1.marketing.StoreAssistance/set_status');
    //助力列表
    Route::get('assistance/list', 'v1.marketing.StoreAssistance/assistance_list');
    //助力人列表
    Route::get('assistance/order_assistance/:id', 'v1.marketing.StoreAssistance/order_assistance');
    //积分日志列表
    Route::get('integral', 'v1.marketing.UserPoint/index');
    //导出积分日志
    Route::get('integral/export', 'v1.marketing.UserPoint/export');
    //积分日志头部数据
    Route::get('integral/statistics', 'v1.marketing.UserPoint/integral_statistics');
    //弹屏广告列表
    Route::get('popScreen', 'v1.marketing.PopScreen/index');
    //弹屏广告详情
    Route::get('popScreen/:id', 'v1.marketing.PopScreen/read');
    //保存新增或编辑
    Route::post('popScreen/:id', 'v1.marketing.PopScreen/save');
    //删除
    Route::delete('popScreen/:id', 'v1.marketing.popScreen/delete');
    //充值卡列表
    Route::get('recharge_card', 'v1.marketing.StoreRechargeCard/index');
    //充值卡详情
    Route::get('recharge_card/:id', 'v1.marketing.StoreRechargeCard/read');
    //保存新增或编辑
    Route::post('recharge_card/:id', 'v1.marketing.StoreRechargeCard/save');
    //删除
    Route::delete('recharge_card/:id', 'v1.marketing.StoreRechargeCard/delete');
    //修改充值卡状态
    Route::put('recharge_card/set_status/:id/:status', 'v1.marketing.StoreRechargeCard/set_status');
    //用户充值记录
    Route::get('recharge_card/user_recharge_card', 'v1.marketing.StoreRechargeCard/user_recharge_card');
    //用户返现记录
    Route::get('recharge_card/user_brokerage', 'v1.marketing.StoreRechargeCard/user_brokerage');
})->middleware([
    \app\http\middleware\AllowOriginMiddleware::class,
    \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
    \app\adminapi\middleware\AdminCkeckRole::class
]);
