RouteServiceProvider.php 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <?php
  2. namespace App\Providers;
  3. use Illuminate\Routing\Router;
  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. * @param \Illuminate\Routing\Router $router
  19. * @return void
  20. */
  21. public function boot()
  22. {
  23. //
  24. parent::boot();
  25. }
  26. /**
  27. * Define the routes for the application.
  28. *
  29. * @param \Illuminate\Routing\Router $router
  30. * @return void
  31. */
  32. public function map(Router $router)
  33. {
  34. $this->mapGdtRoutes($router);
  35. // $this->mapFinanceRoutes($router);
  36. // $this->mapBookRoutes($router);
  37. // $this->mapUserRoutes($router);
  38. // $this->mapSendOrderRoutes($router);
  39. // $this->mapBadInfoRoutes($router);//敏感词
  40. // $this->mapTradeRoutes($router);
  41. $this->mapOfficialAccountRoutes($router);
  42. // $this->mapChannelOfficialAccountRoutes($router);
  43. // $this->mapUserAndUserOrderRoutes($router);
  44. // $this->mapWebRoutes($router);
  45. $this->mapCommonRoutes($router);
  46. }
  47. protected function mapFinanceRoutes(Router $router)
  48. {
  49. $router->group([
  50. 'middleware' => 'web',
  51. ], function ($router) {
  52. require app_path('Http/Routes/Channel/FinanceRoutes.php');
  53. require app_path('Http/Routes/Manage/FinanceRoutes.php');
  54. });
  55. }
  56. protected function mapGdtRoutes(Router $router)
  57. {
  58. $router->group([
  59. 'middleware' => 'web',
  60. ], function ($router) {
  61. require app_path('Http/Routes/Outer/GdtRoutes.php');
  62. });
  63. }
  64. protected function mapBookRoutes(Router $router)
  65. {
  66. $router->group([
  67. 'middleware' => 'web',
  68. ], function ($router) {
  69. require app_path('Http/Routes/Manage/BookRoutes.php');
  70. require app_path('Http/Routes/Channel/BookRoutes.php');
  71. require app_path('Http/Routes/Cp/BookRoutes.php');
  72. });
  73. }
  74. protected function mapUserRoutes(Router $router)
  75. {
  76. $router->group([
  77. 'middleware' => 'web',
  78. ], function ($router) {
  79. require app_path('Http/Routes/Manage/UserRoutes.php');
  80. });
  81. }
  82. protected function mapSendOrderRoutes(Router $router)
  83. {
  84. $router->group([
  85. 'middleware' => 'web',
  86. ], function ($router) {
  87. require app_path('Http/Routes/Channel/SendOrderRoutes.php');
  88. require app_path('Http/Routes/Manage/SendOrderRoutes.php');
  89. });
  90. }
  91. protected function mapPayRoutes(Router $router)
  92. {
  93. $router->group([
  94. 'middleware' => 'web',
  95. ], function ($router) {
  96. require app_path('Http/Routes/Manage/PayRoutes.php');
  97. });
  98. }
  99. protected function mapTradeRoutes(Router $router)
  100. {
  101. $router->group([
  102. 'middleware' => 'web',
  103. ], function ($router) {
  104. require app_path('Http/Routes/Channel/TradeRoutes.php');
  105. require app_path('Http/Routes/Manage/TradeRoutes.php');
  106. });
  107. }
  108. protected function mapOfficialAccountRoutes(Router $router)
  109. {
  110. // $router->group([
  111. // 'middleware' => 'web',
  112. // ], function ($router) {
  113. // require app_path('Http/Routes/Wap/OfficialAccountRoutes.php');
  114. // require app_path('Http/Routes/Manage/OfficialAccountRoutes.php');
  115. // });
  116. $router->group([
  117. 'middleware' => 'wap',
  118. ], function ($router) {
  119. require app_path('Http/Routes/Wechat/OfficialAccountRoutes.php');
  120. });
  121. }
  122. protected function mapChannelOfficialAccountRoutes(Router $router)
  123. {
  124. $router->group([
  125. 'middleware' => 'web',
  126. ], function ($router) {
  127. require app_path('Http/Routes/Channel/OfficialAccountRoutes.php');
  128. });
  129. }
  130. //敏感词
  131. public function mapBadInfoRoutes(Router $router)
  132. {
  133. $router->group([
  134. 'middleware' => 'web',
  135. ], function ($router) {
  136. require app_path('Http/Routes/Manage/BadInfoRoutes.php');
  137. });
  138. }
  139. //UI界面
  140. protected function mapWebRoutes(Router $router)
  141. {
  142. $router->group([
  143. 'middleware' => 'web',
  144. ], function ($router) {
  145. require app_path('Http/Routes/Channel/WebRoutes.php');
  146. require app_path('Http/Routes/Manage/WebRoutes.php');
  147. require app_path('Http/Routes/Cp/WebRoutes.php');
  148. });
  149. }
  150. //分销用户信息和用户订单
  151. public function mapUserAndUserOrderRoutes(Router $router)
  152. {
  153. $router->group([
  154. 'middleware' => 'web',
  155. ], function ($router) {
  156. require app_path('Http/Routes/Channel/UserRoutes.php');
  157. require app_path('Http/Routes/Channel/OrderRoutes.php');
  158. });
  159. }
  160. //分销支付宝路由
  161. public function mapAliRoutes(Router $router)
  162. {
  163. $router->group([
  164. 'middleware' => 'web',
  165. ], function ($router) {
  166. require app_path('Http/Routes/Channel/AliRoutes.php');
  167. });
  168. }
  169. //分销小程序路由
  170. public function mapXcxRoutes(Router $router)
  171. {
  172. $router->group([
  173. 'middleware' => 'web',
  174. ], function ($router) {
  175. require app_path('Http/Routes/Channel/XcxRoutes.php');
  176. });
  177. }
  178. //分销红包路由
  179. public function mapWelfareRoutes(Router $router)
  180. {
  181. $router->group([
  182. 'middleware' => 'web',
  183. ], function ($router) {
  184. require app_path('Http/Routes/Channel/WelfareRoutes.php');
  185. });
  186. }
  187. //
  188. public function mapAgentsRoutes(Router $router)
  189. {
  190. $router->group([
  191. 'middleware' => 'web',
  192. ], function ($router) {
  193. require app_path('Http/Routes/Agents/AgentsManageRoutes.php');
  194. });
  195. }
  196. //淘万卷
  197. public function mapTaowjRoutes(Router $router)
  198. {
  199. $router->group([
  200. 'middleware' => 'web',
  201. ], function ($router) {
  202. require app_path('Http/Routes/Taowj/TaowjRoutes.php');
  203. });
  204. }
  205. /**
  206. * 公共接口
  207. */
  208. public function mapCommonRoutes(Router $router)
  209. {
  210. $router->group([
  211. 'middleware' => 'api',
  212. 'prefix' => 'api',
  213. ], function ($router) {
  214. require app_path('Http/Routes/Common/CommonRoute.php');
  215. });
  216. }
  217. }