RouteServiceProvider.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <?php
  2. namespace App\Providers;
  3. use Illuminate\Support\Facades\Route;
  4. use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
  5. class RouteServiceProvider extends ServiceProvider
  6. {
  7. /**
  8. * This namespace is applied to your controller routes.
  9. *
  10. * In addition, it is set as the URL generator's root namespace.
  11. *
  12. * @var string
  13. */
  14. protected $namespace = 'App\Http\Controllers';
  15. /**
  16. * @var string
  17. */
  18. protected $apinamespace = 'App\Http\ApiControllers';
  19. /**
  20. * Define your route model bindings, pattern filters, etc.
  21. *
  22. * @return void
  23. */
  24. public function boot()
  25. {
  26. //
  27. parent::boot();
  28. }
  29. /**
  30. * Define the routes for the application.
  31. *
  32. * @return void
  33. */
  34. public function map()
  35. {
  36. $this->mapApiRoutes();
  37. $this->mapWebRoutes();
  38. //
  39. }
  40. /**
  41. * Define the "web" routes for the application.
  42. *
  43. * These routes all receive session state, CSRF protection, etc.
  44. *
  45. * @return void
  46. */
  47. protected function mapWebRoutes()
  48. {
  49. Route::middleware('web')
  50. ->namespace($this->namespace)
  51. ->group(base_path('routes/web.php'));
  52. Route::namespace($this->namespace)
  53. ->group(base_path('routes/plain.php'));
  54. }
  55. /**
  56. * Define the "api" routes for the application.
  57. *
  58. * These routes are typically stateless.
  59. *
  60. * @return void
  61. */
  62. protected function mapApiRoutes()
  63. {
  64. Route::prefix('api')
  65. ->middleware('api')
  66. ->namespace($this->apinamespace)
  67. ->group(base_path('routes/api.php'));
  68. Route::prefix('apiLocal')
  69. ->middleware('apiLocal')
  70. ->namespace($this->namespace)
  71. ->group(base_path('routes/apiLocal.php'));
  72. Route::prefix('api/email/send')
  73. ->middleware('api')
  74. ->namespace('App\Http\Controllers\api\email')
  75. ->group(base_path('routes/api/email/send.php'));
  76. Route::prefix('api/thirdPart/flux')
  77. ->middleware('api')
  78. ->namespace('App\Http\Controllers\api\thirdPart\flux')
  79. ->group(base_path('routes/api/thirdPart/flux.php'));
  80. Route::prefix('api/thirdPart/weight')
  81. ->middleware('api')
  82. ->namespace('App\Http\Controllers\api\thirdPart\weight')
  83. ->group(base_path('routes/api/thirdPart/weight.php'));
  84. Route::prefix('api/thirdPart/weixin')
  85. ->namespace('App\Http\Controllers\api\thirdPart\weixin')
  86. ->group(base_path('routes/api/thirdPart/weixin.php'));
  87. Route::prefix('api/thirdPart/haiq')
  88. ->namespace('App\Http\Controllers\api\thirdPart\haiq')
  89. ->group(base_path('routes/api/thirdPart/haiq.php'));
  90. Route::prefix('api/thirdPart/goodscan')
  91. ->namespace('App\Http\Controllers\api\thirdPart\goodscan')
  92. ->group(base_path('routes/api/thirdPart/goodscan.php'));
  93. Route::prefix('api/thirdPart/hengli')
  94. ->namespace('App\Http\Controllers\api\thirdPart\hengli')
  95. ->group(base_path('routes/api/thirdPart/hengli.php'));
  96. Route::prefix('api/thirdPart/haochuang')
  97. ->middleware('api')
  98. ->namespace('App\Http\Controllers\api\thirdPart\haochuang')
  99. ->group(base_path('routes/api/thirdPart/haochuang.php'));
  100. Route::prefix("api/thirdPart/syrius")
  101. ->namespace('App\Http\Controllers\api\thirdPart\syrius\consumer')
  102. ->group(base_path('routes/api/thirdPart/syrius.php'));
  103. }
  104. }