api.php 8.7 KB

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