out.php 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. use app\http\middleware\AllowOriginMiddleware;
  3. use app\http\middleware\InstallMiddleware;
  4. use app\http\middleware\out\AuthTokenMiddleware;
  5. use app\http\middleware\StationOpenMiddleware;
  6. use think\facade\Route;
  7. /**
  8. * 对外接口路由配置
  9. */
  10. Route::group('outapi', function () {
  11. Route::group(function () {
  12. //获取token
  13. Route::post('get_token', 'OutAccount/getToken')->name('getToken');
  14. });
  15. //授权接口
  16. Route::group(function () {
  17. //商品
  18. Route::get('product/detail/:spu', 'Product/detail')->name('detail');//商品详情
  19. Route::put('product/set_show/:spu/:is_show', 'Product/set_show')->name('setShow');//商品状态
  20. Route::get('product/category', 'Product/category')->name('category');//分类列表
  21. Route::post('product/set_stock/:spu', 'Product/set_stock')->name('setStock');//商品库存
  22. //订单
  23. Route::get('order/list', 'Order/lst')->name('OrderList');//订单列表
  24. Route::get('order/get_status/:oid', 'Order/get_status')->name('GetStatus');//订单状态
  25. Route::get('order/get_shipping_type/:oid', 'Order/get_shipping_type')->name('GetShippingType');//收货方式接口
  26. Route::get('order/delivery_type/:oid', 'Order/delivery_type')->name('deliveryType');//配送信息接口
  27. Route::put('order/take_delivery/:oid', 'Order/take_delivery')->name('takeDelivery');//确认收货接口
  28. Route::get('order/invoice/:oid', 'Order/invoice')->name('invoice');//查询发票接口
  29. Route::get('order/detail/:oid', 'Order/detail')->name('detail');//订单详情接口
  30. Route::get('order/refund/list', 'Order/refund_list')->name('refundList');//售后订单接口
  31. Route::post('order/update/:oid', 'Order/update')->name('update');//改价
  32. Route::get('order/postage', 'Order/postage')->name('postage');//获取商品运费
  33. Route::post('cart/add', 'Order/cart_add')->name('cartAdd'); //购物车添加
  34. Route::get('order/confirm', 'Order/confirm')->name('confirm');//订单确认
  35. Route::post('order/create', 'Order/create')->name('create');//提交订单
  36. //会员
  37. Route::get('user/detail/:uid', 'User/index')->name('detail'); //会员详情
  38. Route::post('user/update_other/:id', 'User/update_other')->name('update_other');//修改积分余额
  39. Route::post('user/save/:id', 'User/update')->name('update');//用户信息修改
  40. Route::get('user/address/:uid', 'User/address_list')->name('addressList');//用户地址列表
  41. Route::get('user/money/:uid', 'User/money')->name('money'); //获取余额详情
  42. Route::get('user/spread_commission/:uid', 'User/spread_commission')->name('spreadCommission'); //余额佣金明细
  43. })->middleware(AuthTokenMiddleware::class, true);
  44. })->prefix('out.')->middleware(InstallMiddleware::class)->middleware(AllowOriginMiddleware::class)->middleware(StationOpenMiddleware::class);