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

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