Browse Source

Merge branch 'develop'

wzq 5 years ago
parent
commit
6affb5d825
3 changed files with 14 additions and 3 deletions
  1. 9 0
      app/Http/Controllers/V1/PostController.php
  2. 1 1
      public/index.php
  3. 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();
+    }
+
 }

+ 1 - 1
public/index.php

@@ -10,7 +10,7 @@
 | is ready to receive HTTP / Console requests from the environment.
 |
 */
-
+ini_set('molten.service_name', 'community-service');
 $app = require __DIR__.'/../bootstrap/app.php';
 
 /*

+ 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');
         //删除内容