<?php

use think\facade\Route;

Route::group('product', function () {
    //规则列表
    Route::get('rule', 'v1.ProductRule/index');
    //规则 保存新建或编辑
    Route::rule('rule/:id', 'v1.ProductRule/save');
    //规则详情
    Route::rule('ruleInfo/:id', 'v1.ProductRule/read');
    //删除属性规则
    Route::rule('rule/delete', 'v1.ProductRule/delete');
    //获取规则属性模板
    Route::rule('get_rule', 'v1.Product/get_rule');
    //生成属性
    Route::rule('generate_attr/:id', 'v1.Product/is_format_attr');
    //商品列表头
    Route::get('type_header', 'v1.Product/type_header');
    //商品列表
    Route::rule('list', 'v1.Product/index');
    //商品详情
    Route::rule('productInfo/:id', 'v1.Product/get_product_info');
    //保存商品
    Route::rule('product/:id', 'v1.Product/save');
    //加入回收站
    Route::rule('del/:id', 'v1.Product/delete');
    //修改商品状态
    Route::rule('set_show/:id/:is_show', 'v1.Product/set_show');
    //设置批量商品上架
    Route::rule('product_show', 'v1.Product/product_show');

})->middleware([
    \app\system\middleware\AllowOriginMiddleware::class,
    \app\system\middleware\AdminAuthTokenMiddleware::class
]);
