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

125 lines
4.2 KiB

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