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

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