api.php 11 KB

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