api.php 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | API Routes
  5. |--------------------------------------------------------------------------
  6. |
  7. | Here is where you can register API routes for your application. These
  8. | routes are loaded by the RouteServiceProvider within a group which
  9. | is assigned the "api" middleware group. Enjoy building your API!
  10. |
  11. */
  12. //Route::middleware('auth:api')->get('/user', function (Request $request) {
  13. // return $request->user();
  14. //});
  15. $api = app('Dingo\Api\Routing\Router');
  16. $api->version('v1', ['namespace' => 'App\Http\Controllers\Api\V1'], function ($api) {
  17. //附件下载
  18. $api->get('attachment/download/{md5}', [
  19. 'as' => 'attachment.download',
  20. 'uses' => 'AttachmentController@download',
  21. ]);
  22. //附件上传
  23. $api->post('attachment/upload', [
  24. 'as' => 'attachment.upload',
  25. 'uses' => 'AttachmentController@upload',
  26. ]);
  27. //附件删除
  28. $api->get('attachment/delete/{md5}', [
  29. 'as' => 'attachment.delete',
  30. 'uses' => 'AttachmentController@delete',
  31. ]);
  32. //上传头像
  33. $api->post('auth/avatar', [
  34. 'as' => 'auth.avatar',
  35. 'uses' => 'AuthController@avatar',
  36. ]);
  37. // test
  38. $api->get('test', [
  39. 'as' => 'test',
  40. 'uses' => 'AuthController@test',
  41. ]);
  42. // Auth
  43. // signin
  44. $api->post('auth/login', [
  45. 'as' => 'auth.login',
  46. 'uses' => 'AuthController@login',
  47. ]);
  48. $api->get('auth/logout', [
  49. 'as' => 'auth.logout',
  50. 'uses' => 'AuthController@logout',
  51. ]);
  52. $api->post('auth/code', [
  53. 'as' => 'auth.code',
  54. 'uses' => 'AuthController@getCode',
  55. ]);
  56. // signup
  57. $api->post('auth/register', [
  58. 'as' => 'auth.register',
  59. 'uses' => 'AuthController@register',
  60. ]);
  61. $api->post('auth/password', [
  62. 'as' => 'auth.reset',
  63. 'uses' => 'AuthController@setPassword',
  64. ]);
  65. $api->post('auth/check_password', [
  66. 'as' => 'auth.check_password',
  67. 'uses' => 'AuthController@check_password',
  68. ]);
  69. $api->post('auth/reset', [
  70. 'as' => 'auth.reset',
  71. 'uses' => 'AuthController@reset',
  72. ]);
  73. $api->get('auth/is_login', [
  74. 'as' => 'auth.is_login',
  75. 'uses' => 'AuthController@isLogin',
  76. ]);
  77. //首页
  78. $api->get('index/home', [
  79. 'as' => 'index.home',
  80. 'uses' => 'IndexController@home',
  81. ]);
  82. $api->get('index/search', [
  83. 'as' => 'index.search',
  84. 'uses' => 'IndexController@search',
  85. ]);
  86. $api->get('index/user_search', [
  87. 'as' => 'index.user_search',
  88. 'uses' => 'IndexController@userSearch',
  89. ]);
  90. //我的
  91. $api->get('my/show', [
  92. 'as' => 'my.show',
  93. 'uses' => 'MyController@show',
  94. ]);
  95. $api->get('my/persona', [
  96. 'as' => 'my.persona',
  97. 'uses' => 'MyController@persona',
  98. ]);
  99. $api->get('my/edit', [
  100. 'as' => 'my.edit',
  101. 'uses' => 'MyController@edit',
  102. ]);
  103. $api->post('my/update', [
  104. 'as' => 'my.update',
  105. 'uses' => 'MyController@update',
  106. ]);
  107. // 充值
  108. $api->post('my/recharge', [
  109. 'as' => 'my.recharge',
  110. 'uses' => 'MyController@recharge',
  111. ]);
  112. $api->get('my/system_info', [
  113. 'as' => 'my.system_info',
  114. 'uses' => 'MyController@systemInfo',
  115. ]);
  116. $api->get('my/reply_my', [
  117. 'as' => 'my.reply_my',
  118. 'uses' => 'MyController@replyMy',
  119. ]);
  120. $api->get('my/dream', [
  121. 'as' => 'my.dream',
  122. 'uses' => 'MyController@dream',
  123. ]);
  124. // 我的收藏
  125. $api->get('my/collection', [
  126. 'as' => 'my.collection',
  127. 'uses' => 'MyController@collection',
  128. ]);
  129. // 关于喵喵
  130. $api->get('my/setting', [
  131. 'as' => 'my.setting',
  132. 'uses' => 'MyController@setting',
  133. ]);
  134. // 联系客服
  135. $api->post('my/suggest', [
  136. 'as' => 'my.suggest',
  137. 'uses' => 'MyController@suggest',
  138. ]);
  139. // 提现
  140. $api->post('my/cash', [
  141. 'as' => 'my.cash',
  142. 'uses' => 'MyController@cash',
  143. ]);
  144. // 用户信息
  145. $api->get('user/show', [
  146. 'as' => 'user.show',
  147. 'uses' => 'HomeController@show',
  148. ]);
  149. // 见面
  150. $api->get('user/meet', [
  151. 'as' => 'user.meet',
  152. 'uses' => 'HomeController@meet',
  153. ]);
  154. // 梦想
  155. $api->get('dream/show', [
  156. 'as' => 'dream.show',
  157. 'uses' => 'DreamController@show',
  158. ]);
  159. $api->get('dream/search', [
  160. 'as' => 'dream.search',
  161. 'uses' => 'DreamController@search',
  162. ]);
  163. $api->get('dream/collection', [
  164. 'as' => 'dream.collection',
  165. 'uses' => 'DreamController@collection',
  166. ]);
  167. $api->post('dream/support', [
  168. 'as' => 'dream.support',
  169. 'uses' => 'DreamController@support',
  170. ]);
  171. $api->post('dream/store', [
  172. 'as' => 'dream.store',
  173. 'uses' => 'DreamController@store',
  174. ]);
  175. // interaction 动态
  176. $api->post('interaction/store', [
  177. 'as' => 'interaction.store',
  178. 'uses' => 'InteractionController@store',
  179. ]);
  180. $api->post('interaction/comment', [
  181. 'as' => 'interaction.comment',
  182. 'uses' => 'InteractionController@comment',
  183. ]);
  184. $api->post('interaction/reply', [
  185. 'as' => 'interaction.reply',
  186. 'uses' => 'InteractionController@reply',
  187. ]);
  188. });