RouteServiceProvider.php 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  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. * Define your route model bindings, pattern filters, etc.
  17. *
  18. * @return void
  19. */
  20. public function boot()
  21. {
  22. //
  23. parent::boot();
  24. }
  25. /**
  26. * Define the routes for the application.
  27. *
  28. * @return void
  29. */
  30. public function map()
  31. {
  32. $this->mapApiRoutes();
  33. $this->mapWebRoutes();
  34. $this->mapCallbacksRoutes();
  35. $this->mapGoodnightRoutes();
  36. $this->mapShareRoutes();
  37. $this->mapPairRoutes();
  38. $this->mapAdminRoutes();
  39. $this->mapAppRoutes();
  40. $this->mapDeedRoutes();
  41. $this->mapFriendRoutes();
  42. $this->mapGteamRoutes();
  43. $this->mapCommonRoutes();
  44. $this->mapMediaRoutes();
  45. $this->mapUserRoutes();
  46. $this->mapHomeRoutes();
  47. $this->mapLogRoutes();
  48. $this->mapAuthRoutes();
  49. $this->mapPayRoutes();
  50. $this->mapSyjRoutes();
  51. $this->mapLikeInviteRoutes();
  52. $this->mapOpenidRoutes();
  53. $this->mapQQprogramRoutes();
  54. $this->mapSignRoutes();
  55. $this->mapChargePartnerRoutes();
  56. $this->mapStubApiRoutes();
  57. }
  58. /**
  59. * Define the "web" routes for the application.
  60. *
  61. * These routes all receive session state, CSRF protection, etc.
  62. *
  63. * @return void
  64. */
  65. protected function mapWebRoutes()
  66. {
  67. Route::namespace($this->namespace)
  68. ->middleware('web')
  69. ->group(base_path('routes/web.php'));
  70. }
  71. /**
  72. * Define the "api" routes for the application.
  73. *
  74. * These routes are typically stateless.
  75. *
  76. * @return void
  77. */
  78. protected function mapApiRoutes()
  79. {
  80. Route::prefix('api')
  81. ->namespace($this->namespace)
  82. ->middleware('api')
  83. ->group(base_path('routes/api.php'));
  84. }
  85. protected function mapCallbacksRoutes()
  86. {
  87. Route::namespace($this->namespace)
  88. ->group(base_path('routes/callbacks.php'));
  89. }
  90. protected function mapGoodnightRoutes()
  91. {
  92. Route::prefix('api/goodnight')
  93. ->namespace($this->namespace)
  94. ->middleware('api')
  95. ->group(base_path('routes/goodnight.php'));
  96. }
  97. protected function mapShareRoutes()
  98. {
  99. Route::prefix('api/share')
  100. ->namespace($this->namespace)
  101. ->middleware('api')
  102. ->group(base_path('routes/share.php'));
  103. }
  104. protected function mapPairRoutes()
  105. {
  106. Route::prefix('api/pair')
  107. ->namespace($this->namespace)
  108. ->middleware('api')
  109. ->group(base_path('routes/pair.php'));
  110. }
  111. protected function mapAdminRoutes()
  112. {
  113. Route::prefix('api/admin')
  114. ->namespace($this->namespace)
  115. ->middleware('api')
  116. ->group(base_path('routes/admin.php'));
  117. }
  118. protected function mapAppRoutes()
  119. {
  120. Route::prefix('api/app')
  121. ->namespace($this->namespace)
  122. ->middleware('api')
  123. ->group(base_path('routes/app.php'));
  124. }
  125. protected function mapDeedRoutes()
  126. {
  127. Route::prefix('api/deed')
  128. ->namespace($this->namespace)
  129. ->middleware('api')
  130. ->group(base_path('routes/deed.php'));
  131. }
  132. protected function mapFriendRoutes()
  133. {
  134. Route::prefix('api/friend')
  135. ->namespace($this->namespace)
  136. ->middleware('api')
  137. ->group(base_path('routes/v2_17_3/friend.php'));
  138. }
  139. protected function mapGteamRoutes()
  140. {
  141. Route::prefix('api/gteam')
  142. ->namespace($this->namespace)
  143. ->middleware('api')
  144. ->group(base_path('routes/gteam.php'));
  145. }
  146. protected function mapCommonRoutes()
  147. {
  148. Route::prefix('api/common')
  149. ->namespace($this->namespace)
  150. ->middleware('api')
  151. ->group(base_path('routes/common.php'));
  152. }
  153. protected function mapMediaRoutes()
  154. {
  155. Route::prefix('api/media')
  156. ->namespace($this->namespace)
  157. ->middleware('api')
  158. ->group(base_path('routes/media.php'));
  159. }
  160. protected function mapUserRoutes()
  161. {
  162. Route::prefix('api/user')
  163. ->namespace($this->namespace)
  164. ->middleware('api')
  165. ->group(base_path('routes/user.php'));
  166. }
  167. protected function mapHomeRoutes()
  168. {
  169. Route::prefix('api/home')
  170. ->namespace($this->namespace)
  171. ->middleware('api')
  172. ->group(base_path('routes/home.php'));
  173. }
  174. protected function mapLogRoutes()
  175. {
  176. Route::prefix('api/log')
  177. ->namespace($this->namespace)
  178. ->middleware('api')
  179. ->group(base_path('routes/log.php'));
  180. }
  181. protected function mapAuthRoutes()
  182. {
  183. Route::prefix('api/auth')
  184. ->namespace($this->namespace)
  185. ->middleware('api')
  186. ->group(base_path('routes/auth.php'));
  187. }
  188. protected function mapPayRoutes()
  189. {
  190. Route::prefix('api/pay')
  191. ->namespace($this->namespace)
  192. ->middleware('api')
  193. ->group(base_path('routes/pay.php'));
  194. }
  195. protected function mapSyjRoutes()
  196. {
  197. Route::prefix('api/syj')
  198. ->namespace($this->namespace)
  199. ->middleware('api')
  200. ->group(base_path('routes/syj.php'));
  201. }
  202. protected function mapLikeInviteRoutes()
  203. {
  204. Route::prefix('api/likeinvite')
  205. ->namespace($this->namespace)
  206. ->middleware('api')
  207. ->group(base_path('routes/likeinvite.php'));
  208. }
  209. protected function mapOpenidRoutes()
  210. {
  211. Route::prefix('api/openid')
  212. ->namespace($this->namespace)
  213. ->middleware('api')
  214. ->group(base_path('routes/openid.php'));
  215. }
  216. protected function mapQQprogramRoutes()
  217. {
  218. Route::prefix('api/qqprogram')
  219. ->namespace($this->namespace)
  220. ->middleware('api')
  221. ->group(base_path('routes/qqprogram.php'));
  222. }
  223. protected function mapSignRoutes()
  224. {
  225. Route::prefix('api/sign')
  226. ->namespace($this->namespace)
  227. ->middleware('api')
  228. ->group(base_path('routes/sign.php'));
  229. }
  230. protected function mapChargePartnerRoutes()
  231. {
  232. Route::prefix('')
  233. ->namespace($this->namespace)
  234. ->middleware('api')
  235. ->group(base_path('routes/chargePartner.php'));
  236. }
  237. protected function mapStubApiRoutes()
  238. {
  239. Route::prefix('stub-api')
  240. ->namespace('App\Generated\Controllers')
  241. ->middleware('stub-api')
  242. ->group(base_path('routes/generated_routes.php'));
  243. }
  244. }