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

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