海南旅游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.

146 lines
5.3 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'); //小程序端支付异步通知
  24. Route::post('refund/{agent_id}', 'WxpayController@refund')->name('wxpay_refund'); //小程序端支付退款通知
  25. Route::post('industry_product_notify', 'WxpayController@IndustryProductNotify')->name('wxpay_industry_product_notify'); //行业产品微信支付回调
  26. Route::post('settled_notify', 'WxpayController@SettledNotify')->name('wxpay_settled_notify'); //商家入驻微信支付回调
  27. });
  28. # 跳转到外部小程序支付
  29. Route::post('share_pay', 'SharePayController@pay');
  30. # 小程序授权等相关
  31. Route::any('auth_event', 'MiniProgramController@authEvent');
  32. Route::any('msg_event/{appid?}', 'MiniProgramController@msgEvent');
  33. });
  34. # 仅用于测试
  35. Route::any('t/index', App\Http\Controllers\Api\TestController::class . '@index');
  36. # 无需登录可获取数据
  37. Route::namespace('App\Http\Controllers\Api')
  38. ->middleware(App\Http\Middleware\ApiBase::class)
  39. ->group(function () {
  40. # 首页
  41. Route::post('index', 'IndexController@index');
  42. # 频道
  43. Route::prefix('channel')->group(function () {
  44. Route::post('list', 'CategoryController@index_channel'); //频道列表
  45. });
  46. # 产品
  47. Route::prefix('agent_product')->group(function () {
  48. Route::post('list', 'AgentProductController@index'); //产品列表
  49. Route::post('guess', 'AgentProductController@guessLike'); //猜你喜欢
  50. Route::post('show', 'AgentProductController@show'); //产品详情
  51. Route::post('recommend', 'AgentProductController@recommendList'); //我的下方推荐
  52. Route::post('hot', 'AgentProductController@hotList'); //人气爆款列表
  53. Route::post('search', 'AgentProductController@search'); //首页搜索框
  54. Route::post('travel_search', 'AgentProductController@travel_search'); //旅游线路搜索
  55. });
  56. # 产品分类
  57. Route::prefix('category')->group(function() {
  58. Route::post('list', 'CategoryController@index');
  59. });
  60. # 公告
  61. Route::prefix('notice')->group(function () {
  62. Route::post('list', 'NoticeController@index'); //公告列表
  63. Route::post('show', 'NoticeController@show'); //公告详情
  64. });
  65. # 文章
  66. Route::prefix('article')->group(function () {
  67. Route::post('list', 'ArticleController@index'); //文章列表
  68. Route::post('show', 'ArticleController@show'); //文章详情
  69. });
  70. # 代理商信息
  71. Route::post('agent_info/{type}', 'AgentInfoController@info');
  72. # 专题
  73. Route::prefix('special')->group(function () {
  74. Route::post('show', 'SpecialController@show'); //专题详情
  75. });
  76. });
  77. # 需要登录才能请求
  78. Route::namespace('App\Http\Controllers\Api')
  79. ->middleware([App\Http\Middleware\ApiBase::class, App\Http\Middleware\ApiAuth::class])
  80. ->group(function () {
  81. # 我的频道
  82. Route::prefix('user_channel')->group(function () {
  83. Route::post('list', 'UserCategoryController@index'); //我的频道列表
  84. Route::post('update', 'UserCategoryController@update'); //编辑我的频道
  85. });
  86. # 订单
  87. Route::prefix('order')->group(function () {
  88. Route::post('list', 'OrderController@index'); //订单列表
  89. Route::post('create', 'OrderController@create'); //创建订单
  90. Route::post('save', 'OrderController@save'); //修改订单
  91. Route::post('price', 'OrderController@getPrice'); //获取订单价格
  92. Route::post('show', 'OrderController@show'); //订单详情
  93. Route::post('refund', 'OrderController@refund'); //申请退款
  94. Route::post('pay', 'OrderController@pay'); //支付
  95. });
  96. # 核销订单
  97. Route::prefix('verification')->group(function () {
  98. Route::post('verify', 'VerificationController@verify');
  99. Route::post('industry_verify', 'VerificationController@industry_verify'); //行业产品订单核销
  100. });
  101. # 短信息
  102. Route::prefix('message')->group(function () {
  103. Route::post('list', 'MessageController@index'); //消息列表
  104. Route::post('show', 'MessageController@show'); //消息列表
  105. });
  106. # 收藏
  107. Route::prefix('fav')->group(function () {
  108. Route::post('list', 'UserFavController@index'); //收藏列表
  109. Route::post('create', 'UserFavController@create'); //添加收藏
  110. Route::post('delete', 'UserFavController@delete'); //删除收藏
  111. });
  112. # 用户
  113. Route::prefix('user')->group(function () {
  114. Route::post('info', 'UserController@info'); //解密用户信息
  115. Route::post('profile', 'UserController@profile'); //解密用户信息
  116. //Route::post('bindingMobile', 'UserController@bindingMobile'); //解密用户信息
  117. });
  118. # 文件上传
  119. Route::prefix('upload')->group(function () {
  120. Route::post('image', 'UploadController@image'); //图片上传
  121. });
  122. });