product.php 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. use think\facade\Route;
  12. Route::group('product', function () {
  13. /** 商品分类 */
  14. Route::group(function () {
  15. Route::get('category', 'v1.product.StoreCategory/index')->option(['real_name' => '商品分类列表']);
  16. //商品树形列表
  17. Route::get('category/tree/:type', 'v1.product.StoreCategory/tree_list')->option(['real_name' => '商品分类树形列表']);
  18. //商品分类树形列表
  19. Route::get('category/cascader/:type', 'v1.product.StoreCategory/cascader_list')->option(['real_name' => '商品分类树形列表']);
  20. //商品分类新增表单
  21. Route::get('category/create', 'v1.product.StoreCategory/create')->option(['real_name' => '商品分类新增表单']);
  22. //商品分类新增
  23. Route::post('category', 'v1.product.StoreCategory/save')->option(['real_name' => '商品分类新增']);
  24. //商品分类编辑表单
  25. Route::get('category/:id', 'v1.product.StoreCategory/edit')->option(['real_name' => '商品分类编辑表单']);
  26. //商品分类编辑
  27. Route::put('category/:id', 'v1.product.StoreCategory/update')->option(['real_name' => '商品分类编辑']);
  28. //删除商品分类
  29. Route::delete('category/:id', 'v1.product.StoreCategory/delete')->option(['real_name' => '删除商品分类']);
  30. //商品分类修改状态
  31. Route::put('category/set_show/:id/:is_show', 'v1.product.StoreCategory/set_show')->option(['real_name' => '商品分类修改状态']);
  32. //商品分类快捷编辑
  33. Route::put('category/set_category/:id', 'v1.product.StoreCategory/set_category')->option(['real_name' => '商品分类快捷编辑']);
  34. })->option(['parent' => 'product', 'cate_name' => '商品分类']);
  35. /** 商品 */
  36. Route::group(function () {
  37. //商品列表
  38. Route::get('product', 'v1.product.StoreProduct/index')->option(['real_name' => '商品列表']);
  39. //获取退出未保存的数据
  40. Route::get('cache', 'v1.product.StoreProduct/getCacheData')->option(['real_name' => '获取退出未保存的数据']);
  41. //1分钟保存一次数据
  42. Route::post('cache', 'v1.product.StoreProduct/saveCacheData')->option(['real_name' => '保存还未提交数据']);
  43. //获取所有商品列表
  44. Route::get('product/list', 'v1.product.StoreProduct/search_list')->option(['real_name' => '获取所有商品列表']);
  45. //获取商品规格
  46. Route::get('product/attrs/:id/:type', 'v1.product.StoreProduct/get_attrs')->option(['real_name' => '获取商品规格']);
  47. //商品列表头
  48. Route::get('product/type_header', 'v1.product.StoreProduct/type_header')->option(['real_name' => '商品列表头部数据']);
  49. //修改商品状态
  50. Route::put('product/set_show/:id/:is_show', 'v1.product.StoreProduct/set_show')->option(['real_name' => '修改商品状态']);
  51. //商品快速编辑
  52. // Route::put('product/set_product/:id', 'v1.product.StoreProduct/set_product')->option(['real_name' => '商品快速编辑']);
  53. //设置批量商品上架
  54. Route::put('product/product_show', 'v1.product.StoreProduct/product_show')->option(['real_name' => '设置批量商品上架']);
  55. //设置批量商品下架
  56. Route::put('product/product_unshow', 'v1.product.StoreProduct/product_unshow')->option(['real_name' => '设置批量商品下架']);
  57. //规则列表
  58. Route::get('product/rule', 'v1.product.StoreProductRule/index')->option(['real_name' => '商品规则列表']);
  59. //规则 保存新建或编辑
  60. Route::post('product/rule/:id', 'v1.product.StoreProductRule/save')->option(['real_name' => '新建或编辑商品规则']);
  61. //规则详情
  62. Route::get('product/rule/:id', 'v1.product.StoreProductRule/read')->option(['real_name' => '商品规则详情']);
  63. //删除属性规则
  64. Route::delete('product/rule/delete', 'v1.product.StoreProductRule/delete')->option(['real_name' => '删除商品规则']);
  65. //获取规则属性模板
  66. Route::get('product/get_rule', 'v1.product.StoreProduct/get_rule')->option(['real_name' => '获取商品规则属性模板']);
  67. //获取运费模板
  68. Route::get('product/get_template', 'v1.product.StoreProduct/get_template')->option(['real_name' => '获取运费模板']);
  69. //上传视频密钥接口
  70. Route::get('product/get_temp_keys', 'v1.product.StoreProduct/getTempKeys')->option(['real_name' => '上传视频密钥接口']);
  71. //检测是否有活动开启
  72. Route::get('product/check_activity/:id', 'v1.product.StoreProduct/check_activity')->option(['real_name' => '检测是商品否有活动开启']);
  73. //导入虚拟商品卡密
  74. Route::get('product/import_card', 'v1.product.StoreProduct/import_card')->option(['real_name' => '导入虚拟商品卡密']);
  75. //商品详情
  76. Route::get('product/:id', 'v1.product.StoreProduct/get_product_info')->option(['real_name' => '商品详情']);
  77. //加入回收站
  78. Route::delete('product/:id', 'v1.product.StoreProduct/delete')->option(['real_name' => '商品放入回收站']);
  79. //保存新建或保存
  80. Route::post('product/:id', 'v1.product.StoreProduct/save')->option(['real_name' => '新建或修改商品']);
  81. //生成属性
  82. Route::post('generate_attr/:id/:type', 'v1.product.StoreProduct/is_format_attr')->option(['real_name' => '生成商品规格列表']);
  83. //商品批量操作
  84. Route::post('batch/setting', 'v1.product.StoreProduct/batchSetting')->option(['real_name' => '商品批量设置']);
  85. })->option(['parent' => 'product', 'cate_name' => '商品']);
  86. /** 商品评论 */
  87. Route::group(function () {
  88. //评论列表
  89. Route::get('reply', 'v1.product.StoreProductReply/index')->option(['real_name' => '商品评论列表']);
  90. //回复评论
  91. Route::put('reply/set_reply/:id', 'v1.product.StoreProductReply/set_reply')->option(['real_name' => '商品回复评论']);
  92. //删除评论
  93. Route::delete('reply/:id', 'v1.product.StoreProductReply/delete')->option(['real_name' => '删除商品评论']);
  94. //调起虚拟评论表单
  95. Route::get('reply/fictitious_reply/:product_id', 'v1.product.StoreProductReply/fictitious_reply')->option(['real_name' => '虚拟评论表单']);
  96. //保存虚拟评论
  97. Route::post('reply/save_fictitious_reply', 'v1.product.StoreProductReply/save_fictitious_reply')->option(['real_name' => '保存虚拟评论']);
  98. })->option(['parent' => 'product', 'cate_name' => '商品评论']);
  99. /** 商品采集 */
  100. Route::group(function () {
  101. //获取商品数据
  102. Route::post('crawl', 'v1.product.CopyTaobao/get_request_contents')->option(['real_name' => '获取采集商品数据']);
  103. //获取复制商品配置
  104. Route::get('copy_config', 'v1.product.CopyTaobao/getConfig')->option(['real_name' => '获取复制商品配置']);
  105. //复制其他平台商品
  106. Route::post('copy', 'v1.product.CopyTaobao/copyProduct')->option(['real_name' => '复制其他平台商品']);
  107. //保存商品数据
  108. Route::post('crawl/save', 'v1.product.CopyTaobao/save_product')->option(['real_name' => '保存采集商品数据']);
  109. })->option(['parent' => 'product', 'cate_name' => '商品采集']);
  110. })->middleware([
  111. \app\http\middleware\AllowOriginMiddleware::class,
  112. \app\adminapi\middleware\AdminAuthTokenMiddleware::class,
  113. \app\adminapi\middleware\AdminCheckRoleMiddleware::class,
  114. \app\adminapi\middleware\AdminLogMiddleware::class
  115. ])->option(['mark' => 'product', 'mark_name' => '商品管理']);