api.php 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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/step', [
  104. 'as' => 'my.step',
  105. 'uses' => 'MyController@step',
  106. ]);
  107. $api->get('my/persona', [
  108. 'as' => 'my.persona',
  109. 'uses' => 'MyController@persona',
  110. ]);
  111. $api->get('my/edit', [
  112. 'as' => 'my.edit',
  113. 'uses' => 'MyController@edit',
  114. ]);
  115. $api->post('my/update', [
  116. 'as' => 'my.update',
  117. 'uses' => 'MyController@update',
  118. ]);
  119. // 充值
  120. $api->post('my/recharge', [
  121. 'as' => 'my.recharge',
  122. 'uses' => 'MyController@recharge',
  123. ]);
  124. $api->get('my/system_info', [
  125. 'as' => 'my.system_info',
  126. 'uses' => 'MyController@systemInfo',
  127. ]);
  128. $api->get('my/dream_info', [
  129. 'as' => 'my.dream_info',
  130. 'uses' => 'MyController@dreamInfo',
  131. ]);
  132. $api->get('my/sure_meet', [
  133. 'as' => 'my.sure_meet',
  134. 'uses' => 'MyController@isOk',
  135. ]);
  136. $api->get('my/sure_meet2', [
  137. 'as' => 'my.sure_meet2',
  138. 'uses' => 'MyController@isOk2',
  139. ]);
  140. $api->get('my/sup_info', [
  141. 'as' => 'my.sup_info',
  142. 'uses' => 'MyController@supInfo',
  143. ]);
  144. $api->get('my/dream', [
  145. 'as' => 'my.dream',
  146. 'uses' => 'MyController@dream',
  147. ]);
  148. $api->post('/my/letter/store', [
  149. 'as' => 'my.letterstore',
  150. 'uses' => 'MyController@letterStore',
  151. ]);
  152. $api->get('/my/letter/show', [
  153. 'as' => 'my.lettershow',
  154. 'uses' => 'MyController@letterShow',
  155. ]);
  156. $api->get('/my/account_log', [
  157. 'as' => 'my.account_log',
  158. 'uses' => 'MyController@accountLog',
  159. ]);
  160. $api->get('my/care', [
  161. 'as' => 'my.care',
  162. 'uses' => 'MyController@care',
  163. ]);
  164. $api->get('my/careme', [
  165. 'as' => 'my.careme',
  166. 'uses' => 'MyController@careMe',
  167. ]);
  168. // 我的收藏
  169. $api->get('my/collection', [
  170. 'as' => 'my.collection',
  171. 'uses' => 'MyController@collection',
  172. ]);
  173. // 关于喵喵
  174. $api->get('my/miao', [
  175. 'as' => 'my.miao',
  176. 'uses' => 'MyController@aboutMiao',
  177. ]);
  178. // 消息中心
  179. $api->get('my/info', [
  180. 'as' => 'my.info',
  181. 'uses' => 'MyController@info',
  182. ]);
  183. $api->get('my/read', [
  184. 'as' => 'my.read',
  185. 'uses' => 'MyController@read',
  186. ]);
  187. // 联系客服
  188. $api->post('my/suggest', [
  189. 'as' => 'my.suggest',
  190. 'uses' => 'MyController@suggest',
  191. ]);
  192. // 提现
  193. $api->post('my/cash', [
  194. 'as' => 'my.cash',
  195. 'uses' => 'MyController@cash',
  196. ]);
  197. $api->get('my/cash/page', [
  198. 'as' => 'my.cash_page',
  199. 'uses' => 'MyController@cashPage',
  200. ]);
  201. $api->get('my/bank/list', [
  202. 'as' => 'my.bank_list',
  203. 'uses' => 'MyController@bankList',
  204. ]);
  205. $api->get('my/bank/account', [
  206. 'as' => 'my.account',
  207. 'uses' => 'MyController@account',
  208. ]);
  209. $api->post('my/bank/create', [
  210. 'as' => 'my.bank_create',
  211. 'uses' => 'MyController@bankCreate',
  212. ]);
  213. $api->post('my/bank/qrcode', [
  214. 'as' => 'my.qrcode',
  215. 'uses' => 'MyController@bankImgCreate',
  216. ]);
  217. $api->get('my/bank/delete', [
  218. 'as' => 'my.bank_delete',
  219. 'uses' => 'MyController@bankDelete',
  220. ]);
  221. $api->get('my/pay/article', [
  222. 'as' => 'my.pay_article',
  223. 'uses' => 'MyController@payArticle',
  224. ]);
  225. // 用户信息
  226. $api->get('user/show', [
  227. 'as' => 'user.show',
  228. 'uses' => 'HomeController@show',
  229. ]);
  230. // 关注用户
  231. $api->get('user/care', [
  232. 'as' => 'user.care',
  233. 'uses' => 'HomeController@care',
  234. ]);
  235. // 见面
  236. $api->get('user/meet', [
  237. 'as' => 'user.meet',
  238. 'uses' => 'HomeController@meet',
  239. ]);
  240. // 梦想
  241. $api->get('dream/show', [
  242. 'as' => 'dream.show',
  243. 'uses' => 'DreamController@show',
  244. ]);
  245. $api->get('dream/share', [
  246. 'as' => 'dream.share',
  247. 'uses' => 'DreamController@share',
  248. ]);
  249. $api->get('dream/search', [
  250. 'as' => 'dream.search',
  251. 'uses' => 'DreamController@search',
  252. ]);
  253. $api->get('dream/collection', [
  254. 'as' => 'dream.collection',
  255. 'uses' => 'DreamController@collection',
  256. ]);
  257. $api->post('dream/support', [
  258. 'as' => 'dream.support',
  259. 'uses' => 'DreamController@support',
  260. ]);
  261. $api->post('dream/store', [
  262. 'as' => 'dream.store',
  263. 'uses' => 'DreamController@store',
  264. ]);
  265. // interaction 动态
  266. $api->post('interaction/store', [
  267. 'as' => 'interaction.store',
  268. 'uses' => 'InteractionController@store',
  269. ]);
  270. $api->post('interaction/comment', [
  271. 'as' => 'interaction.comment',
  272. 'uses' => 'InteractionController@comment',
  273. ]);
  274. $api->post('interaction/reply', [
  275. 'as' => 'interaction.reply',
  276. 'uses' => 'InteractionController@reply',
  277. ]);
  278. $api->get('/comment/delete', [ //删除评论
  279. 'as' => 'interaction.delete',
  280. 'uses' => 'InteractionController@delete',
  281. ]);
  282. $api->get('/interaction/add_comment_blackList', [ //加入黑名单
  283. 'as' => 'interaction.add_comment_blackList',
  284. 'uses' => 'InteractionController@addCommentBlackList',
  285. ]);
  286. $api->get('/interaction/destroy', [ //删除动态
  287. 'as' => 'interaction.destroy',
  288. 'uses' => 'InteractionController@destroy',
  289. ]);
  290. //jpush
  291. $api->post('user/jpush', [
  292. 'as' => 'user.jpush',
  293. 'uses' => 'MyController@jpush',
  294. ]);
  295. //支付宝支付回调
  296. $api->post('pay/alipay/notify', [
  297. 'as' => 'pay.alipay.notify',
  298. 'uses' => 'PayController@alipayNotify',
  299. ]);
  300. //微信支付回调
  301. $api->post('pay/wechatpay/notify', [
  302. 'as' => 'pay.wechatpay.notify',
  303. 'uses' => 'PayController@wechatpayNotify',
  304. ]);
  305. //商户充值
  306. $api->post('pay/charge', [
  307. 'as' => 'pay.charge',
  308. 'uses' => 'PayController@charge',
  309. ]);
  310. //充值状态
  311. $api->get('pay/order_status', [
  312. 'as' => 'pay.order_status',
  313. 'uses' => 'PayController@orderStatus',
  314. ]);
  315. //商户充值
  316. $api->get('pay/order_ios', [
  317. 'as' => 'pay.order_ios',
  318. 'uses' => 'PayController@orderIos',
  319. ]);
  320. });