api.php 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  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. // info
  43. $api->get('info', [
  44. 'as' => 'info',
  45. 'uses' => 'AuthController@info',
  46. ]);
  47. // Auth
  48. // signin
  49. $api->post('auth/login', [
  50. 'as' => 'login',
  51. 'uses' => 'AuthController@login',
  52. ]);
  53. $api->get('auth/wechat_login', [
  54. 'as' => 'wechat_login',
  55. 'uses' => 'AuthController@wechatLogin',
  56. ]);
  57. $api->get('auth/logout', [
  58. 'as' => 'auth.logout',
  59. 'uses' => 'AuthController@logout',
  60. ]);
  61. $api->post('auth/code', [
  62. 'as' => 'auth.code',
  63. 'uses' => 'AuthController@getCode',
  64. ]);
  65. // signup
  66. $api->post('auth/register', [
  67. 'as' => 'auth.register',
  68. 'uses' => 'AuthController@register',
  69. ]);
  70. $api->post('auth/password', [
  71. 'as' => 'auth.reset',
  72. 'uses' => 'AuthController@setPassword',
  73. ]);
  74. $api->post('auth/check_password', [
  75. 'as' => 'auth.check_password',
  76. 'uses' => 'AuthController@check_password',
  77. ]);
  78. $api->post('auth/reset', [
  79. 'as' => 'auth.reset',
  80. 'uses' => 'AuthController@reset',
  81. ]);
  82. $api->get('auth/is_login', [
  83. 'as' => 'auth.is_login',
  84. 'uses' => 'AuthController@isLogin',
  85. ]);
  86. //首页
  87. $api->get('index/home', [
  88. 'as' => 'index.home',
  89. 'uses' => 'IndexController@home',
  90. ]);
  91. $api->get('index/filter', [
  92. 'as' => 'index.filter',
  93. 'uses' => 'IndexController@filter',
  94. ]);
  95. $api->get('index/search', [
  96. 'as' => 'index.search',
  97. 'uses' => 'IndexController@search',
  98. ]);
  99. $api->get('index/user_search', [
  100. 'as' => 'index.user_search',
  101. 'uses' => 'IndexController@userSearch',
  102. ]);
  103. //我的
  104. $api->get('my/show', [
  105. 'as' => 'my.show',
  106. 'uses' => 'MyController@show',
  107. ]);
  108. $api->get('my/step', [
  109. 'as' => 'my.step',
  110. 'uses' => 'MyController@step',
  111. ]);
  112. $api->get('my/persona', [
  113. 'as' => 'my.persona',
  114. 'uses' => 'MyController@persona',
  115. ]);
  116. $api->get('my/edit', [
  117. 'as' => 'my.edit',
  118. 'uses' => 'MyController@edit',
  119. ]);
  120. $api->post('my/update', [
  121. 'as' => 'my.update',
  122. 'uses' => 'MyController@update',
  123. ]);
  124. // 充值
  125. $api->post('my/recharge', [
  126. 'as' => 'my.recharge',
  127. 'uses' => 'MyController@recharge',
  128. ]);
  129. $api->get('my/system_info', [
  130. 'as' => 'my.system_info',
  131. 'uses' => 'MyController@systemInfo',
  132. ]);
  133. $api->get('my/dream_info', [
  134. 'as' => 'my.dream_info',
  135. 'uses' => 'MyController@dreamInfo',
  136. ]);
  137. $api->get('my/sure_meet', [
  138. 'as' => 'my.sure_meet',
  139. 'uses' => 'MyController@isOk',
  140. ]);
  141. $api->get('my/sure_meet2', [
  142. 'as' => 'my.sure_meet2',
  143. 'uses' => 'MyController@isOk2',
  144. ]);
  145. $api->get('my/sup_info', [
  146. 'as' => 'my.sup_info',
  147. 'uses' => 'MyController@supInfo',
  148. ]);
  149. $api->get('my/dream', [
  150. 'as' => 'my.dream',
  151. 'uses' => 'MyController@dream',
  152. ]);
  153. $api->post('/my/letter/store', [
  154. 'as' => 'my.letterstore',
  155. 'uses' => 'MyController@letterStore',
  156. ]);
  157. $api->get('/my/letter/show', [
  158. 'as' => 'my.lettershow',
  159. 'uses' => 'MyController@letterShow',
  160. ]);
  161. $api->get('/my/account_log', [
  162. 'as' => 'my.account_log',
  163. 'uses' => 'MyController@accountLog',
  164. ]);
  165. $api->get('my/care', [
  166. 'as' => 'my.care',
  167. 'uses' => 'MyController@care',
  168. ]);
  169. $api->get('my/careme', [
  170. 'as' => 'my.careme',
  171. 'uses' => 'MyController@careMe',
  172. ]);
  173. // 我的收藏
  174. $api->get('my/collection', [
  175. 'as' => 'my.collection',
  176. 'uses' => 'MyController@collection',
  177. ]);
  178. // 关于喵喵
  179. $api->get('my/miao', [
  180. 'as' => 'my.miao',
  181. 'uses' => 'MyController@aboutMiao',
  182. ]);
  183. // 消息中心
  184. $api->get('my/info', [
  185. 'as' => 'my.info',
  186. 'uses' => 'MyController@info',
  187. ]);
  188. $api->get('my/read', [
  189. 'as' => 'my.read',
  190. 'uses' => 'MyController@read',
  191. ]);
  192. // 联系客服
  193. $api->post('my/suggest', [
  194. 'as' => 'my.suggest',
  195. 'uses' => 'MyController@suggest',
  196. ]);
  197. // 提现
  198. $api->post('my/cash', [
  199. 'as' => 'my.cash',
  200. 'uses' => 'MyController@cash',
  201. ]);
  202. $api->get('my/cash/page', [
  203. 'as' => 'my.cash_page',
  204. 'uses' => 'MyController@cashPage',
  205. ]);
  206. $api->get('my/bank/list', [
  207. 'as' => 'my.bank_list',
  208. 'uses' => 'MyController@bankList',
  209. ]);
  210. $api->get('my/bank/account', [
  211. 'as' => 'my.account',
  212. 'uses' => 'MyController@account',
  213. ]);
  214. $api->post('my/bank/create', [
  215. 'as' => 'my.bank_create',
  216. 'uses' => 'MyController@bankCreate',
  217. ]);
  218. $api->post('my/bank/qrcode', [
  219. 'as' => 'my.qrcode',
  220. 'uses' => 'MyController@bankImgCreate',
  221. ]);
  222. $api->get('my/bank/delete', [
  223. 'as' => 'my.bank_delete',
  224. 'uses' => 'MyController@bankDelete',
  225. ]);
  226. $api->get('my/pay/article', [
  227. 'as' => 'my.pay_article',
  228. 'uses' => 'MyController@payArticle',
  229. ]);
  230. // 用户信息
  231. $api->get('user/show', [
  232. 'as' => 'user.show',
  233. 'uses' => 'HomeController@show',
  234. ]);
  235. // 关注用户
  236. $api->get('user/care', [
  237. 'as' => 'user.care',
  238. 'uses' => 'HomeController@care',
  239. ]);
  240. // 见面
  241. $api->get('user/meet', [
  242. 'as' => 'user.meet',
  243. 'uses' => 'HomeController@meet',
  244. ]);
  245. // 梦想
  246. $api->get('dream/show', [
  247. 'as' => 'dream.show',
  248. 'uses' => 'DreamController@show',
  249. ]);
  250. $api->get('dream/share', [
  251. 'as' => 'dream.share',
  252. 'uses' => 'DreamController@share',
  253. ]);
  254. $api->get('dream/search', [
  255. 'as' => 'dream.search',
  256. 'uses' => 'DreamController@search',
  257. ]);
  258. $api->get('dream/collection', [
  259. 'as' => 'dream.collection',
  260. 'uses' => 'DreamController@collection',
  261. ]);
  262. $api->post('dream/support', [
  263. 'as' => 'dream.support',
  264. 'uses' => 'DreamController@support',
  265. ]);
  266. $api->post('dream/store', [
  267. 'as' => 'dream.store',
  268. 'uses' => 'DreamController@store',
  269. ]);
  270. // interaction 动态
  271. $api->post('interaction/store', [
  272. 'as' => 'interaction.store',
  273. 'uses' => 'InteractionController@store',
  274. ]);
  275. $api->post('interaction/comment', [
  276. 'as' => 'interaction.comment',
  277. 'uses' => 'InteractionController@comment',
  278. ]);
  279. $api->post('interaction/reply', [
  280. 'as' => 'interaction.reply',
  281. 'uses' => 'InteractionController@reply',
  282. ]);
  283. $api->get('/comment/delete', [ //删除评论
  284. 'as' => 'interaction.delete',
  285. 'uses' => 'InteractionController@delete',
  286. ]);
  287. $api->get('/interaction/add_comment_blackList', [ //加入黑名单
  288. 'as' => 'interaction.add_comment_blackList',
  289. 'uses' => 'InteractionController@addCommentBlackList',
  290. ]);
  291. $api->get('/interaction/destroy', [ //删除动态
  292. 'as' => 'interaction.destroy',
  293. 'uses' => 'InteractionController@destroy',
  294. ]);
  295. //jpush
  296. $api->post('user/jpush', [
  297. 'as' => 'user.jpush',
  298. 'uses' => 'MyController@jipush',
  299. ]);
  300. //支付宝支付回调
  301. $api->post('pay/alipay/notify', [
  302. 'as' => 'pay.alipay.notify',
  303. 'uses' => 'PayController@alipayNotify',
  304. ]);
  305. //微信支付回调
  306. $api->post('pay/wechatpay/notify', [
  307. 'as' => 'pay.wechatpay.notify',
  308. 'uses' => 'PayController@wechatpayNotify',
  309. ]);
  310. //商户充值
  311. $api->post('pay/charge', [
  312. 'as' => 'pay.charge',
  313. 'uses' => 'PayController@charge',
  314. ]);
  315. //充值状态
  316. $api->get('pay/order_status', [
  317. 'as' => 'pay.order_status',
  318. 'uses' => 'PayController@orderStatus',
  319. ]);
  320. //商户充值
  321. $api->get('pay/order_ios', [
  322. 'as' => 'pay.order_ios',
  323. 'uses' => 'PayController@orderIos',
  324. ]);
  325. });