api.php 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  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/dream_info', [
  125. 'as' => 'my.dream_info',
  126. 'uses' => 'MyController@dreamInfo',
  127. ]);
  128. $api->get('my/sure_meet', [
  129. 'as' => 'my.sure_meet',
  130. 'uses' => 'MyController@isOk',
  131. ]);
  132. $api->get('my/sup_info', [
  133. 'as' => 'my.sup_info',
  134. 'uses' => 'MyController@supInfo',
  135. ]);
  136. $api->get('my/dream', [
  137. 'as' => 'my.dream',
  138. 'uses' => 'MyController@dream',
  139. ]);
  140. $api->post('/my/letter/store', [
  141. 'as' => 'my.letterstore',
  142. 'uses' => 'MyController@letterStore',
  143. ]);
  144. $api->get('/my/letter/show', [
  145. 'as' => 'my.lettershow',
  146. 'uses' => 'MyController@letterShow',
  147. ]);
  148. $api->get('my/care', [
  149. 'as' => 'my.care',
  150. 'uses' => 'MyController@care',
  151. ]);
  152. $api->get('my/careme', [
  153. 'as' => 'my.careme',
  154. 'uses' => 'MyController@careMe',
  155. ]);
  156. // 我的收藏
  157. $api->get('my/collection', [
  158. 'as' => 'my.collection',
  159. 'uses' => 'MyController@collection',
  160. ]);
  161. // 关于喵喵
  162. $api->get('my/miao', [
  163. 'as' => 'my.miao',
  164. 'uses' => 'MyController@aboutMiao',
  165. ]);
  166. // 消息中心
  167. $api->get('my/info', [
  168. 'as' => 'my.info',
  169. 'uses' => 'MyController@info',
  170. ]);
  171. $api->get('my/read', [
  172. 'as' => 'my.read',
  173. 'uses' => 'MyController@read',
  174. ]);
  175. // 联系客服
  176. $api->post('my/suggest', [
  177. 'as' => 'my.suggest',
  178. 'uses' => 'MyController@suggest',
  179. ]);
  180. // 提现
  181. $api->post('my/cash', [
  182. 'as' => 'my.cash',
  183. 'uses' => 'MyController@cash',
  184. ]);
  185. $api->get('my/cash/page', [
  186. 'as' => 'my.cash_page',
  187. 'uses' => 'MyController@cashPage',
  188. ]);
  189. $api->get('my/bank/list', [
  190. 'as' => 'my.bank_list',
  191. 'uses' => 'MyController@bankList',
  192. ]);
  193. $api->get('my/bank/account', [
  194. 'as' => 'my.account',
  195. 'uses' => 'MyController@account',
  196. ]);
  197. $api->post('my/bank/create', [
  198. 'as' => 'my.bank_create',
  199. 'uses' => 'MyController@bankCreate',
  200. ]);
  201. $api->post('my/bank/qrcode', [
  202. 'as' => 'my.qrcode',
  203. 'uses' => 'MyController@bankImgCreate',
  204. ]);
  205. $api->get('my/bank/delete', [
  206. 'as' => 'my.bank_delete',
  207. 'uses' => 'MyController@bankDelete',
  208. ]);
  209. $api->get('my/pay/article', [
  210. 'as' => 'my.pay_article',
  211. 'uses' => 'MyController@payArticle',
  212. ]);
  213. // 用户信息
  214. $api->get('user/show', [
  215. 'as' => 'user.show',
  216. 'uses' => 'HomeController@show',
  217. ]);
  218. // 关注用户
  219. $api->get('user/care', [
  220. 'as' => 'user.care',
  221. 'uses' => 'HomeController@care',
  222. ]);
  223. // 见面
  224. $api->get('user/meet', [
  225. 'as' => 'user.meet',
  226. 'uses' => 'HomeController@meet',
  227. ]);
  228. // 梦想
  229. $api->get('dream/show', [
  230. 'as' => 'dream.show',
  231. 'uses' => 'DreamController@show',
  232. ]);
  233. $api->get('dream/share', [
  234. 'as' => 'dream.share',
  235. 'uses' => 'DreamController@share',
  236. ]);
  237. $api->get('dream/search', [
  238. 'as' => 'dream.search',
  239. 'uses' => 'DreamController@search',
  240. ]);
  241. $api->get('dream/collection', [
  242. 'as' => 'dream.collection',
  243. 'uses' => 'DreamController@collection',
  244. ]);
  245. $api->post('dream/support', [
  246. 'as' => 'dream.support',
  247. 'uses' => 'DreamController@support',
  248. ]);
  249. $api->post('dream/store', [
  250. 'as' => 'dream.store',
  251. 'uses' => 'DreamController@store',
  252. ]);
  253. // interaction 动态
  254. $api->post('interaction/store', [
  255. 'as' => 'interaction.store',
  256. 'uses' => 'InteractionController@store',
  257. ]);
  258. $api->post('interaction/comment', [
  259. 'as' => 'interaction.comment',
  260. 'uses' => 'InteractionController@comment',
  261. ]);
  262. $api->post('interaction/reply', [
  263. 'as' => 'interaction.reply',
  264. 'uses' => 'InteractionController@reply',
  265. ]);
  266. $api->get('/comment/delete', [ //删除评论
  267. 'as' => 'interaction.delete',
  268. 'uses' => 'InteractionController@delete',
  269. ]);
  270. $api->get('/interaction/destroy', [ //删除动态
  271. 'as' => 'interaction.destroy',
  272. 'uses' => 'InteractionController@destroy',
  273. ]);
  274. //支付宝支付回调
  275. $api->post('pay/alipay/notify', [
  276. 'as' => 'pay.alipay.notify',
  277. 'uses' => 'PayController@alipayNotify',
  278. ]);
  279. //微信支付回调
  280. $api->post('pay/wechatpay/notify', [
  281. 'as' => 'pay.wechatpay.notify',
  282. 'uses' => 'PayController@wechatpayNotify',
  283. ]);
  284. //商户充值
  285. $api->post('pay/charge', [
  286. 'as' => 'pay.charge',
  287. 'uses' => 'PayController@charge',
  288. ]);
  289. });