wzq hace 5 años
padre
commit
a9bfb9fcbc
Se han modificado 2 ficheros con 13 adiciones y 2 borrados
  1. 9 0
      app/Http/Controllers/V1/PostController.php
  2. 4 2
      routes/api.php

+ 9 - 0
app/Http/Controllers/V1/PostController.php

@@ -508,4 +508,13 @@ class PostController extends Controller
         return jsonSuccess($res);
     }
 
+    /**
+     * 下载量
+     */
+    public function downloadCount()
+    {
+        Redis::INCRBY('app_h5_download_count', 1);
+        return jsonSuccess();
+    }
+
 }

+ 4 - 2
routes/api.php

@@ -27,6 +27,9 @@ $api->version('v1', [
     $api->group(['middleware' => ['chxq_sign']], function ($api) {
         //查询帖子内容详情
         $api->get('post/info', 'PostController@find');
+
+        //下载量
+        $api->put('download_count', 'PostController@downloadCount');
     });
     //登录
     $api->group(['middleware' => ['chxq_jwt_auth']], function ($api) {
@@ -67,8 +70,7 @@ $api->version('v1', [
     $api->get('post/checkImage', 'PostController@checkImage');
 
     //登录+验签
-//    $api->group(['middleware' => ['chxq_jwt_auth','chxq_sign']], function ($api) {
-    $api->group(['middleware' => ['chxq_jwt_auth']], function ($api) {
+    $api->group(['middleware' => ['chxq_jwt_auth','chxq_sign']], function ($api) {
         //发布内容
         $api->post('post', 'PostController@create');
         //删除内容