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

147 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
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', 'ChannelController@index'); //频道列表
  45. Route::post('product', 'ChannelController@product'); //频道产品列表
  46. });
  47. # 产品
  48. Route::prefix('agent_product')->group(function () {
  49. Route::post('list', 'AgentProductController@index'); //产品列表
  50. Route::post('guess', 'AgentProductController@guessLike'); //猜你喜欢
  51. Route::post('show', 'AgentProductController@show'); //产品详情
  52. Route::post('recommend', 'AgentProductController@recommendList'); //我的下方推荐
  53. Route::post('hot', 'AgentProductController@hotList'); //人气爆款列表
  54. Route::post('search', 'AgentProductController@search'); //首页搜索框
  55. Route::post('travel_search', 'AgentProductController@travel_search'); //旅游线路搜索
  56. });
  57. # 产品分类
  58. Route::prefix('category')->group(function() {
  59. Route::post('list', 'CategoryController@index');
  60. });
  61. # 公告
  62. Route::prefix('notice')->group(function () {
  63. Route::post('list', 'NoticeController@index'); //公告列表
  64. Route::post('show', 'NoticeController@show'); //公告详情
  65. });
  66. # 文章
  67. Route::prefix('article')->group(function () {
  68. Route::post('list', 'ArticleController@index'); //文章列表
  69. Route::post('show', 'ArticleController@show'); //文章详情
  70. });
  71. # 代理商信息
  72. Route::post('agent_info/{type}', 'AgentInfoController@info');
  73. # 专题
  74. Route::prefix('special')->group(function () {
  75. Route::post('show', 'SpecialController@show'); //专题详情
  76. });
  77. });
  78. # 需要登录才能请求
  79. Route::namespace('App\Http\Controllers\Api')
  80. ->middleware([App\Http\Middleware\ApiBase::class, App\Http\Middleware\ApiAuth::class])
  81. ->group(function () {
  82. # 我的频道
  83. Route::prefix('user_channel')->group(function () {
  84. Route::post('list', 'UserChannelController@index'); //我的频道列表
  85. Route::post('update', 'UserChannelController@update'); //编辑我的频道
  86. });
  87. # 订单
  88. Route::prefix('order')->group(function () {
  89. Route::post('list', 'OrderController@index'); //订单列表
  90. Route::post('create', 'OrderController@create'); //创建订单
  91. Route::post('save', 'OrderController@save'); //修改订单
  92. Route::post('price', 'OrderController@getPrice'); //获取订单价格
  93. Route::post('show', 'OrderController@show'); //订单详情
  94. Route::post('refund', 'OrderController@refund'); //申请退款
  95. Route::post('pay', 'OrderController@pay'); //支付
  96. });
  97. # 核销订单
  98. Route::prefix('verification')->group(function () {
  99. Route::post('verify', 'VerificationController@verify');
  100. Route::post('industry_verify', 'VerificationController@industry_verify'); //行业产品订单核销
  101. });
  102. # 短信息
  103. Route::prefix('message')->group(function () {
  104. Route::post('list', 'MessageController@index'); //消息列表
  105. Route::post('show', 'MessageController@show'); //消息列表
  106. });
  107. # 收藏
  108. Route::prefix('fav')->group(function () {
  109. Route::post('list', 'UserFavController@index'); //收藏列表
  110. Route::post('create', 'UserFavController@create'); //添加收藏
  111. Route::post('delete', 'UserFavController@delete'); //删除收藏
  112. });
  113. # 用户
  114. Route::prefix('user')->group(function () {
  115. Route::post('info', 'UserController@info'); //解密用户信息
  116. Route::post('profile', 'UserController@profile'); //解密用户信息
  117. //Route::post('bindingMobile', 'UserController@bindingMobile'); //解密用户信息
  118. });
  119. # 文件上传
  120. Route::prefix('upload')->group(function () {
  121. Route::post('image', 'UploadController@image'); //图片上传
  122. });
  123. });