From 750dd6b43bc704e01a41687b0288fb346f4d9e5b Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Thu, 29 Jun 2023 23:29:39 -0400 Subject: [PATCH] blog data --- www-api/app/Config/Routes.php | 2 +- www-api/app/Controllers/WrenchBlog.php | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/www-api/app/Config/Routes.php b/www-api/app/Config/Routes.php index 87544cde..2ce2266f 100644 --- a/www-api/app/Config/Routes.php +++ b/www-api/app/Config/Routes.php @@ -167,7 +167,7 @@ $routes->get('/en/wrench/api/v1/blogdata/', 'WrenchBlog::website'); $routes->get('/en/wrench/api/v1/blogdata/(:any)', 'WrenchBlog::blogLimitedData/$1'); $routes->post('/en/wrench/api/v1/blogdata/', 'WrenchBlog::website'); -$routes->post('/en/wrench/api/v1/blogdata/(:any)', 'WrenchBlog::blogLimitedData/$1'); +//$routes->post('/en/wrench/api/v1/blogdata/(:any)', 'WrenchBlog::blogLimitedData/$1'); diff --git a/www-api/app/Controllers/WrenchBlog.php b/www-api/app/Controllers/WrenchBlog.php index 177bfa31..c84bdabb 100644 --- a/www-api/app/Controllers/WrenchBlog.php +++ b/www-api/app/Controllers/WrenchBlog.php @@ -66,7 +66,16 @@ class WrenchBlog extends BaseController } public function website(){ + + $endpoint = "WRENCH_BLOG_DATA"; + $res1 = $this->getCache($endpoint); + if (count($res1)==0){ + $rawData = $this->apiData(); + $res1= $rawData['payload']; //[0]['payload']; + $this->saveCache($endpoint,$res1); + } + return $this->response->setJson($res1); } public function blogLimitedData($inData){