海南旅游SAAS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

145 lines
5.1 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <?php
  2. use Illuminate\Http\Request;
  3. use Illuminate\Support\Facades\Route;
  4. /*
  5. |--------------------------------------------------------------------------
  6. | API Routes
  7. |--------------------------------------------------------------------------
  8. |
  9. | Here is where you can register API routes for your application. These
  10. | routes are loaded by the RouteServiceProvider within a group which
  11. | is assigned the "api" middleware group. Enjoy building your API!
  12. |
  13. */
  14. /*Route::middleware('auth:api')->get('/user', function (Request $request) {
  15. return $request->user();
  16. });*/
  17. # 登录
  18. Route::post('login', 'App\Http\Controllers\Api\LoginController@login');
  19. # 微信相关
  20. Route::namespace('App\Http\Controllers\Api')->group(function () {
  21. # 微信支付
  22. Route::prefix('wxpay')->group(function () {
  23. Route::post('notify/{agent_id}', 'WxpayController@notify')->name('wxpay_notify'); //异步通知,aid为代理商ID
  24. Route::post('refund/{agent_id}', 'WxpayController@refund')->name('wxpay_refund'); //退款通知,aid为代理商ID
  25. });
  26. # 跳转到外部小程序支付
  27. Route::post('share_pay', 'SharePayController@pay');
  28. # 小程序授权等相关
  29. Route::any('auth_event', 'MiniProgramController@authEvent');
  30. Route::any('msg_event/{appid?}', 'MiniProgramController@msgEvent');
  31. });
  32. # 仅用于测试
  33. Route::any('t/index', App\Http\Controllers\Api\TestController::class . '@index');
  34. # 无需登录可获取数据
  35. Route::namespace('App\Http\Controllers\Api')
  36. ->middleware(App\Http\Middleware\ApiBase::class)
  37. ->group(function () {
  38. # 首页
  39. Route::post('index', 'IndexController@index');
  40. # 频道
  41. Route::prefix('channel')->group(function () {
  42. Route::post('list', 'ChannelController@index'); //频道列表
  43. Route::post('product', 'ChannelController@product'); //频道产品列表
  44. });
  45. # 产品
  46. Route::prefix('agent_product')->group(function () {
  47. Route::post('list', 'AgentProductController@index'); //产品列表
  48. Route::post('guess', 'AgentProductController@guessLike'); //猜你喜欢
  49. Route::post('show', 'AgentProductController@show'); //产品详情
  50. Route::post('recommend', 'AgentProductController@recommendList'); //我的下方推荐
  51. Route::post('hot', 'AgentProductController@hotList'); //人气爆款列表
  52. Route::post('search', 'AgentProductController@search'); //首页搜索框
  53. Route::post('travel_search', 'AgentProductController@travel_search'); //旅游线路搜索
  54. });
  55. # 产品分类
  56. Route::prefix('category')->group(function() {
  57. Route::post('list', 'CategoryController@index');
  58. });
  59. # 公告
  60. Route::prefix('notice')->group(function () {
  61. Route::post('list', 'NoticeController@index'); //公告列表
  62. Route::post('show', 'NoticeController@show'); //公告详情
  63. });
  64. # 文章
  65. Route::prefix('article')->group(function () {
  66. Route::post('list', 'ArticleController@index'); //文章列表
  67. Route::post('show', 'ArticleController@show'); //文章详情
  68. });
  69. # 代理商信息
  70. Route::post('agent_info/{type}', 'AgentInfoController@info');
  71. # 专题
  72. Route::prefix('special')->group(function () {
  73. Route::post('show', 'SpecialController@show'); //专题详情
  74. });
  75. });
  76. # 需要登录才能请求
  77. Route::namespace('App\Http\Controllers\Api')
  78. ->middleware([App\Http\Middleware\ApiBase::class, App\Http\Middleware\ApiAuth::class])
  79. ->group(function () {
  80. # 我的频道
  81. Route::prefix('user_channel')->group(function () {
  82. Route::post('list', 'UserChannelController@index'); //我的频道列表
  83. Route::post('update', 'UserChannelController@update'); //编辑我的频道
  84. });
  85. # 订单
  86. Route::prefix('order')->group(function () {
  87. Route::post('list', 'OrderController@index'); //订单列表
  88. Route::post('create', 'OrderController@create'); //创建订单
  89. Route::post('save', 'OrderController@save'); //修改订单
  90. Route::post('price', 'OrderController@getPrice'); //获取订单价格
  91. Route::post('show', 'OrderController@show'); //订单详情
  92. Route::post('refund', 'OrderController@refund'); //申请退款
  93. Route::post('pay', 'OrderController@pay'); //支付
  94. });
  95. # 核销订单
  96. Route::prefix('verification')->group(function () {
  97. Route::post('verify', 'VerificationController@verify');
  98. Route::post('industry_verify', 'VerificationController@industry_verify'); //行业产品订单核销
  99. });
  100. # 短信息
  101. Route::prefix('message')->group(function () {
  102. Route::post('list', 'MessageController@index'); //消息列表
  103. Route::post('show', 'MessageController@show'); //消息列表
  104. });
  105. # 收藏
  106. Route::prefix('fav')->group(function () {
  107. Route::post('list', 'UserFavController@index'); //收藏列表
  108. Route::post('create', 'UserFavController@create'); //添加收藏
  109. Route::post('delete', 'UserFavController@delete'); //删除收藏
  110. });
  111. # 用户
  112. Route::prefix('user')->group(function () {
  113. Route::post('info', 'UserController@info'); //解密用户信息
  114. Route::post('profile', 'UserController@profile'); //解密用户信息
  115. //Route::post('bindingMobile', 'UserController@bindingMobile'); //解密用户信息
  116. });
  117. # 文件上传
  118. Route::prefix('upload')->group(function () {
  119. Route::post('image', 'UploadController@image'); //图片上传
  120. });
  121. });