api.php 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  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. $api = app('Dingo\Api\Routing\Router');
  13. $api->version('v1', [
  14. 'namespace' => 'App\Http\Controllers\Api',
  15. 'middleware' => ['serializer:array','cors','activity_log','bindings']
  16. ], function ($api) {
  17. $api->group([
  18. 'middleware' => 'api.throttle',
  19. 'limit' => config('api.rate_limits.access.limit'),
  20. 'expires' => config('api.rate_limits.access.expires')
  21. ], function ($api) {
  22. /*
  23. |--------------------------------------------------------------
  24. | 首页内容
  25. |--------------------------------------------------------------
  26. */
  27. $api->group(['prefix' => 'home'], function ($api) {
  28. $api->post('/home', 'HomeController@home')->name('home.home');
  29. $api->post('/get_location', 'HomeController@get_location')->name('home.get_location');
  30. $api->post('/get_fx', 'HomeController@get_fx')->name('home.get_fx');
  31. $api->post('/user_detail', 'HomeController@user_detail')->name('home.user_detail');
  32. $api->post('/user_dynamic', 'HomeController@user_dynamic')->name('home.user_dynamic');
  33. $api->post('/photo_destroy', 'HomeController@photo_destroy')->name('home.photo_destroy');
  34. });
  35. /*
  36. |--------------------------------------------------------------
  37. | 动态相关
  38. |--------------------------------------------------------------
  39. */
  40. $api->group(['prefix' => 'dynamic'], function ($api) {
  41. $api->post('/get_tag_list', 'DynamicController@get_tag_list')->name('dynamic.get_tag_list');
  42. $api->post('/get_list', 'DynamicController@get_list')->name('dynamic.get_list');
  43. $api->get('/dynamic_info', 'DynamicController@dynamic_info')->name('dynamic.dynamic_info');
  44. });
  45. /*
  46. |--------------------------------------------------------------
  47. | 登录相关
  48. |--------------------------------------------------------------
  49. */
  50. $api->group(['prefix' => 'login'], function ($api) {
  51. $api->post('/login_by_mobile', 'AuthorizationsController@login_by_mobile')->name('login.mobile');
  52. $api->post('/login_by_password', 'AuthorizationsController@login_by_account_password')->name('login.password');
  53. $api->post('/forget_password', 'AuthorizationsController@forget_password')->name('login.forget');
  54. $api->post('/register', 'AuthorizationsController@register')->name('login.register');
  55. $api->get('/xieyi', 'AuthorizationsController@xieyi')->name('login.xieyi');
  56. $api->get('/captcha', 'AuthorizationsController@captcha')->name('login.captcha');
  57. $api->post('/reg_h5', 'AuthorizationsController@reg_h5')->name('login.reg_h5');
  58. $api->post('/auth_login', 'AuthorizationsController@auth_login')->name('login.auth_login');
  59. });
  60. /*
  61. |--------------------------------------------------------------
  62. | 获取oss上传配置
  63. |--------------------------------------------------------------
  64. */
  65. $api->group(['prefix' => 'upload-config'], function ($api) {
  66. $api->get('/config', 'UploadConfigController@config')->name('upload.config');
  67. });
  68. /*
  69. |--------------------------------------------------------------
  70. | 发送短信验证码
  71. |--------------------------------------------------------------
  72. */
  73. $api->group(['prefix' => 'sms'], function ($api) {
  74. $api->get('/send', 'SmsController@send')->name('sms.send');
  75. });
  76. });
  77. //需要 token 验证的接口
  78. $api->group(['middleware' => 'api.auth',
  79. 'limit' => config('api.rate_limits.access.limit'),
  80. 'expires' => config('api.rate_limits.access.expires')], function ($api) {
  81. /*
  82. |--------------------------------------------------------------
  83. | 用户信息相关
  84. |--------------------------------------------------------------
  85. */
  86. $api->group(['prefix' => 'user'], function ($api) {
  87. //设置性别
  88. $api->post('/checksex', 'UserController@checksex')->name('user.checksex');
  89. //设置资料(初次注册进入时)
  90. $api->post('/setinfo', 'UserController@setinfo')->name('user.setinfo');
  91. $api->post('/setpass', 'UserController@setpass')->name('user.setpass');
  92. $api->get('/getinfo', 'UserController@getinfo')->name('user.getinfo');
  93. $api->get('/get_photo', 'UserController@get_photo')->name('user.get_photo');
  94. $api->post('/upload_file', 'UserController@upload_file')->name('user.upload_file');
  95. $api->post('/updateinfo', 'UserController@updateinfo')->name('user.updateinfo');
  96. $api->post('/problem', 'UserController@problem')->name('user.problem');
  97. $api->post('/looked_me', 'UserController@looked_me')->name('user.looked_me');
  98. $api->get('/get_vip', 'UserController@get_vip')->name('user.get_vip');
  99. $api->post('/buy_vip', 'UserController@buy_vip')->name('user.buy_vip');
  100. $api->post('/check_auth', 'UserController@check_auth')->name('user.check_auth');
  101. $api->post('/black_list', 'UserController@black_list')->name('user.black_list');
  102. $api->post('/del_black', 'UserController@del_black')->name('user.del_black');
  103. $api->post('/online_status', 'UserController@online_status')->name('user.online_status');
  104. $api->get('/get_vip_info', 'UserController@get_vip_info')->name('user.get_vip_info');
  105. $api->get('/invite_info', 'UserController@invite_info')->name('user.invite_info');
  106. $api->post('/get_invite_list', 'UserController@get_invite_list')->name('user.get_invite_list');
  107. $api->get('/receive_day', 'UserController@receive_day')->name('user.receive_day');
  108. $api->post('/del_file', 'UserController@del_file')->name('user.del_file');
  109. $api->post('/auth_center', 'UserController@auth_center')->name('user.auth_center');
  110. $api->get('/distory_user', 'UserController@distory_user')->name('user.distory_user');
  111. $api->get('/share', 'UserController@share')->name('user.share');
  112. $api->get('/getinfo_tag', 'UserController@getinfo_tag')->name('user.getinfo_tag');
  113. $api->get('/reset_password', 'UserController@reset_password')->name('user.reset_password');
  114. });
  115. /*
  116. |--------------------------------------------------------------
  117. | 动态相关
  118. |--------------------------------------------------------------
  119. */
  120. $api->group(['prefix' => 'dynamic'], function ($api) {
  121. $api->post('/release', 'DynamicController@release')->name('dynamic.release');
  122. $api->post('/my_list', 'DynamicController@my_list')->name('dynamic.my_list');
  123. $api->post('/zan', 'DynamicController@zan')->name('dynamic.zan');
  124. $api->post('/del', 'DynamicController@del')->name('dynamic.del');
  125. $api->post('/report', 'DynamicController@report')->name('dynamic.report');
  126. });
  127. /*
  128. |--------------------------------------------------------------
  129. | 首页内容
  130. |--------------------------------------------------------------
  131. */
  132. $api->group(['prefix' => 'home'], function ($api) {
  133. $api->post('/do_like', 'HomeController@do_like')->name('home.do_like');
  134. $api->post('/do_comment', 'HomeController@do_comment')->name('home.do_comment');
  135. $api->post('/get_weixin', 'HomeController@get_weixin')->name('home.get_weixin');
  136. $api->post('/lahei', 'HomeController@lahei')->name('home.lahei');
  137. });
  138. /*
  139. |--------------------------------------------------------------
  140. | 消息相关
  141. |--------------------------------------------------------------
  142. */
  143. $api->group(['prefix' => 'notice'], function ($api) {
  144. $api->post('/get_notice_list', 'NoticeController@get_notice_list')->name('notice.get_notice_list');
  145. $api->post('/get_like_list', 'NoticeController@get_like_list')->name('notice.get_like_list');
  146. $api->post('/get_zan_list', 'NoticeController@get_zan_list')->name('notice.get_zan_list');
  147. $api->post('/get_system_message', 'NoticeController@get_system_message')->name('notice.get_system_message');
  148. $api->post('/del_system_message', 'NoticeController@del_system_message')->name('notice.del_system_message');
  149. });
  150. /*
  151. |--------------------------------------------------------------
  152. | 聊天相关
  153. |--------------------------------------------------------------
  154. */
  155. $api->group(['prefix' => 'chat'], function ($api) {
  156. $api->post('/add_friend', 'ChatController@add_friend')->name('chat.add_friend');
  157. $api->post('/get_friend', 'ChatController@get_friend')->name('chat.get_friend');
  158. });
  159. /*
  160. |--------------------------------------------------------------
  161. | 文件上传
  162. |--------------------------------------------------------------
  163. */
  164. $api->post('/upload', 'UploadController@upload')->name('upload');
  165. /*
  166. |--------------------------------------------------------------
  167. | 退出登录
  168. |--------------------------------------------------------------
  169. */
  170. $api->put('/logout', 'AuthorizationsController@logout')->name('logout');
  171. });
  172. /*
  173. |--------------------------------------------------------------
  174. | 支付回调
  175. |--------------------------------------------------------------
  176. */
  177. $api->any('/wx_notify', 'PayNotifyController@wx_notify')->name('wx_notify');
  178. $api->any('/ali_notify', 'PayNotifyController@ali_notify')->name('ali_notify');
  179. $api->any('/creat_user', 'TestController@creat_user')->name('creat_user');
  180. $api->any('/create_dynamic', 'TestController@create_dynamic')->name('create_dynamic');
  181. $api->any('/test_push', 'TestController@test_push')->name('test_push');
  182. $api->any('/jg_auth', 'TestController@jg_auth')->name('jg_auth');
  183. $api->any('/tencent_notify', 'TencentController@notify')->name('notify');
  184. });