Sfoglia il codice sorgente

不登录单独返回每日新闻、小贴士

durong 5 anni fa
parent
commit
4002eeb8ac

+ 11 - 0
app/Http/Controllers/V1/BeanDetailController.php

@@ -60,4 +60,15 @@ class BeanDetailController extends Controller
             return $this->jsonSuccess();
         }
     }
+
+    //不登录单独返回每日新闻、小贴士
+    public function lists(Request $request)
+    {
+        $star_lists = $this->beanRepository->lists($request->all());
+        if ($star_lists){
+            return $this->jsonSuccess($star_lists);
+        }else{
+            return $this->jsonSuccess();
+        }
+    }
 }

+ 10 - 0
app/Repositories/BeanRepository.php

@@ -304,4 +304,14 @@ class BeanRepository
 
     }
 
+    //不登录单独返回每日新闻、小贴士
+    public function lists($request)
+    {
+        $star_lists = [];
+        $star_lists['daily_news'] = $this->getNews($request);
+        $star_lists['tips'] = $this->getPlatformContent($id = 1);
+
+        return $star_lists;
+    }
+
 }

+ 2 - 1
routes/api.php

@@ -105,5 +105,6 @@ $api->version('v1', [
 
     //分享/邀请首页
     $api->get('starDetail', 'BeanDetailController@starDetail');
-
+    //不登录单独返回每日新闻、小贴士
+    $api->get('/starHome/lists', 'BeanDetailController@lists');
 });