api.php 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  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' => 'login',
  46. 'uses' => 'AuthController@login',
  47. ]);
  48. $api->get('auth/wechat_login', [
  49. 'as' => 'wechat_login',
  50. 'uses' => 'AuthController@wechatLogin',
  51. ]);
  52. $api->get('auth/logout', [
  53. 'as' => 'auth.logout',
  54. 'uses' => 'AuthController@logout',
  55. ]);
  56. $api->post('auth/code', [
  57. 'as' => 'auth.code',
  58. 'uses' => 'AuthController@getCode',
  59. ]);
  60. // signup
  61. $api->post('auth/register', [
  62. 'as' => 'auth.register',
  63. 'uses' => 'AuthController@register',
  64. ]);
  65. $api->post('auth/password', [
  66. 'as' => 'auth.reset',
  67. 'uses' => 'AuthController@setPassword',
  68. ]);
  69. $api->post('auth/check_password', [
  70. 'as' => 'auth.check_password',
  71. 'uses' => 'AuthController@check_password',
  72. ]);
  73. $api->post('auth/reset', [
  74. 'as' => 'auth.reset',
  75. 'uses' => 'AuthController@reset',
  76. ]);
  77. $api->get('auth/is_login', [
  78. 'as' => 'auth.is_login',
  79. 'uses' => 'AuthController@isLogin',
  80. ]);
  81. //首页
  82. $api->get('index/home', [
  83. 'as' => 'index.home',
  84. 'uses' => 'IndexController@home',
  85. ]);
  86. $api->get('index/filter', [
  87. 'as' => 'index.filter',
  88. 'uses' => 'IndexController@filter',
  89. ]);
  90. $api->get('index/search', [
  91. 'as' => 'index.search',
  92. 'uses' => 'IndexController@search',
  93. ]);
  94. $api->get('index/user_search', [
  95. 'as' => 'index.user_search',
  96. 'uses' => 'IndexController@userSearch',
  97. ]);
  98. //我的
  99. $api->get('my/show', [
  100. 'as' => 'my.show',
  101. 'uses' => 'MyController@show',
  102. ]);
  103. $api->get('my/persona', [
  104. 'as' => 'my.persona',
  105. 'uses' => 'MyController@persona',
  106. ]);
  107. $api->get('my/edit', [
  108. 'as' => 'my.edit',
  109. 'uses' => 'MyController@edit',
  110. ]);
  111. $api->post('my/update', [
  112. 'as' => 'my.update',
  113. 'uses' => 'MyController@update',
  114. ]);
  115. // 充值
  116. $api->post('my/recharge', [
  117. 'as' => 'my.recharge',
  118. 'uses' => 'MyController@recharge',
  119. ]);
  120. $api->get('my/system_info', [
  121. 'as' => 'my.system_info',
  122. 'uses' => 'MyController@systemInfo',
  123. ]);
  124. $api->get('my/reply', [
  125. 'as' => 'my.reply',
  126. 'uses' => 'MyController@reply',
  127. ]);
  128. $api->get('my/letter', [
  129. 'as' => 'my.letter',
  130. 'uses' => 'MyController@letter',
  131. ]);
  132. $api->get('my/dream', [
  133. 'as' => 'my.dream',
  134. 'uses' => 'MyController@dream',
  135. ]);
  136. $api->get('my/care', [
  137. 'as' => 'my.care',
  138. 'uses' => 'MyController@care',
  139. ]);
  140. // 我的收藏
  141. $api->get('my/collection', [
  142. 'as' => 'my.collection',
  143. 'uses' => 'MyController@collection',
  144. ]);
  145. // 关于喵喵
  146. $api->get('my/miao', [
  147. 'as' => 'my.miao',
  148. 'uses' => 'MyController@aboutMiao',
  149. ]);
  150. // 消息中心
  151. $api->get('my/info', [
  152. 'as' => 'my.info',
  153. 'uses' => 'MyController@info',
  154. ]);
  155. $api->get('my/read', [
  156. 'as' => 'my.read',
  157. 'uses' => 'MyController@read',
  158. ]);
  159. // 联系客服
  160. $api->post('my/suggest', [
  161. 'as' => 'my.suggest',
  162. 'uses' => 'MyController@suggest',
  163. ]);
  164. // 提现
  165. $api->post('my/cash', [
  166. 'as' => 'my.cash',
  167. 'uses' => 'MyController@cash',
  168. ]);
  169. $api->get('my/cash/page', [
  170. 'as' => 'my.cash_page',
  171. 'uses' => 'MyController@cashPage',
  172. ]);
  173. $api->get('my/bank/list', [
  174. 'as' => 'my.bank_list',
  175. 'uses' => 'MyController@bankList',
  176. ]);
  177. $api->get('my/bank/account', [
  178. 'as' => 'my.account',
  179. 'uses' => 'MyController@account',
  180. ]);
  181. $api->post('my/bank/create', [
  182. 'as' => 'my.bank_create',
  183. 'uses' => 'MyController@bankCreate',
  184. ]);
  185. $api->post('my/bank/qrcode', [
  186. 'as' => 'my.qrcode',
  187. 'uses' => 'MyController@bankImgCreate',
  188. ]);
  189. $api->get('my/bank/delete', [
  190. 'as' => 'my.bank_delete',
  191. 'uses' => 'MyController@bankDelete',
  192. ]);
  193. $api->get('my/pay/article', [
  194. 'as' => 'my.pay_article',
  195. 'uses' => 'MyController@payArticle',
  196. ]);
  197. // 用户信息
  198. $api->get('user/show', [
  199. 'as' => 'user.show',
  200. 'uses' => 'HomeController@show',
  201. ]);
  202. // 关注用户
  203. $api->get('user/care', [
  204. 'as' => 'user.care',
  205. 'uses' => 'HomeController@care',
  206. ]);
  207. // 见面
  208. $api->get('user/meet', [
  209. 'as' => 'user.meet',
  210. 'uses' => 'HomeController@meet',
  211. ]);
  212. // 梦想
  213. $api->get('dream/show', [
  214. 'as' => 'dream.show',
  215. 'uses' => 'DreamController@show',
  216. ]);
  217. $api->get('dream/share', [
  218. 'as' => 'dream.share',
  219. 'uses' => 'DreamController@share',
  220. ]);
  221. $api->get('dream/search', [
  222. 'as' => 'dream.search',
  223. 'uses' => 'DreamController@search',
  224. ]);
  225. $api->get('dream/collection', [
  226. 'as' => 'dream.collection',
  227. 'uses' => 'DreamController@collection',
  228. ]);
  229. $api->post('dream/support', [
  230. 'as' => 'dream.support',
  231. 'uses' => 'DreamController@support',
  232. ]);
  233. $api->post('dream/store', [
  234. 'as' => 'dream.store',
  235. 'uses' => 'DreamController@store',
  236. ]);
  237. // interaction 动态
  238. $api->post('interaction/store', [
  239. 'as' => 'interaction.store',
  240. 'uses' => 'InteractionController@store',
  241. ]);
  242. $api->post('interaction/comment', [
  243. 'as' => 'interaction.comment',
  244. 'uses' => 'InteractionController@comment',
  245. ]);
  246. $api->post('interaction/reply', [
  247. 'as' => 'interaction.reply',
  248. 'uses' => 'InteractionController@reply',
  249. ]);
  250. $api->get('/comment/delete', [ //删除评论
  251. 'as' => 'interaction.delete',
  252. 'uses' => 'InteractionController@delete',
  253. ]);
  254. //支付宝支付回调
  255. $api->post('pay/alipay/notify', [
  256. 'as' => 'pay.alipay.notify',
  257. 'uses' => 'PayController@alipayNotify',
  258. ]);
  259. //微信支付回调
  260. $api->post('pay/wechatpay/notify', [
  261. 'as' => 'pay.wechatpay.notify',
  262. 'uses' => 'PayController@wechatpayNotify',
  263. ]);
  264. //商户充值
  265. $api->post('pay/charge', [
  266. 'as' => 'pay.charge',
  267. 'uses' => 'PayController@charge',
  268. ]);
  269. });