优惠券小程序

api.php 2.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. use Illuminate\Support\Facades\Route;
  3. /*
  4. |--------------------------------------------------------------------------
  5. | API Routes
  6. |--------------------------------------------------------------------------
  7. |
  8. | Here is where you can register API routes for your application. These
  9. | routes are loaded by the RouteServiceProvider within a group which
  10. | is assigned the "api" middleware group. Enjoy building your API!
  11. |
  12. */
  13. Route::group(['namespace' => 'App\Http\Controllers\Api'], function () {
  14. # 小程序登录(不需要登录)
  15. Route::get('/wx/login', 'WechatController@login');
  16. // 登录认证
  17. Route::group(['middleware' => 'api.login'], function () {
  18. # 用户相关
  19. Route::group(['prefix' => 'user'], function () {
  20. # 意见反馈
  21. Route::get('feedback', 'UserController@feedback');
  22. # 商品收藏
  23. Route::post('goodsCollect', 'UserController@goodsCollect');
  24. # 我的收藏/浏览历史
  25. Route::get('myInterest', 'UserController@myInterest');
  26. # 删除收藏/浏览历史
  27. Route::get('removeInterest', 'UserController@removeInterest');
  28. # 搜索历史
  29. Route::get('searchHistory', 'UserController@searchHistory');
  30. # 搜索历史
  31. Route::get('delSearchHistory', 'UserController@delSearchHistory');
  32. # 记录用户分享信息
  33. Route::post('shareRecord', 'UserController@shareRecord');
  34. # 获取用户分享信息
  35. Route::get('shareInfo', 'UserController@shareInfo');
  36. # 设置用户头像和昵称
  37. Route::post('setInfo', 'UserController@setInfo');
  38. });
  39. # 专题
  40. Route::group(['prefix' => 'topic'], function () {
  41. # 专题列表
  42. Route::get('list', 'TopicController@lists');
  43. # 专题商品
  44. Route::get('goods', 'TopicController@goods');
  45. });
  46. Route::group(['prefix' => 'goods'], function () {
  47. # 优选
  48. Route::get('excellentEditor', 'GoodsController@excellentEditor');
  49. # 今日搜榜 好货推荐
  50. Route::get('salesList', 'GoodsController@salesList');
  51. # 搜索
  52. Route::get('goodsSearch', 'GoodsController@goodsSearch');
  53. # 详情
  54. Route::get('goodsDetail', 'GoodsController@goodsDetail');
  55. # 相似商品
  56. Route::get('sameGoods', 'GoodsController@sameGoods');
  57. # 生成淘口令
  58. Route::post('createTaobaoWord', 'GoodsController@createTaobaoWord');
  59. # 首页榜单类型
  60. Route::get('salesTypeList', 'GoodsController@salesTypeList');
  61. });
  62. # 获取客服二维码
  63. Route::get('/wx/qrcode', 'WechatController@qrcode');
  64. });
  65. });