new Api for blog data
This commit is contained in:
@@ -209,10 +209,13 @@ $routes->post('/en/wrench/api/v1/recentactivities', 'WrenchApi::apigate');
|
|||||||
|
|
||||||
$routes->post('/en/wrench/api/v1/reqdel', 'WrenchApi::apigate'); // request delete account
|
$routes->post('/en/wrench/api/v1/reqdel', 'WrenchApi::apigate'); // request delete account
|
||||||
|
|
||||||
$routes->get('/en/wrench/api/v1/blogdata/', 'WrenchBlog::website');
|
|
||||||
$routes->get('/en/wrench/api/v1/blogdata/(:any)', 'WrenchBlog::blogLimitedData/$1');
|
$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', 'WrenchBlog::website');
|
||||||
|
$routes->get('/en/wrench/api/v1/blogdata', 'WrenchBlog::website');
|
||||||
|
|
||||||
|
$routes->post('/en/wrench/api/v1/mobileblogdata', 'WrenchBlog::mobileBlogData');
|
||||||
|
|
||||||
//$routes->post('/en/wrench/api/v1/blogdata/(:any)', 'WrenchBlog::blogLimitedData/$1');
|
//$routes->post('/en/wrench/api/v1/blogdata/(:any)', 'WrenchBlog::blogLimitedData/$1');
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,11 @@ namespace App\Controllers;
|
|||||||
|
|
||||||
//use CodeIgniter\API\ResponseTrait;
|
//use CodeIgniter\API\ResponseTrait;
|
||||||
|
|
||||||
|
use CodeIgniter\API\ResponseTrait;
|
||||||
|
|
||||||
class WrenchBlog extends BaseController
|
class WrenchBlog extends BaseController
|
||||||
{
|
{
|
||||||
|
use ResponseTrait;
|
||||||
//use ResponseTrait;
|
//use ResponseTrait;
|
||||||
|
|
||||||
protected $db;
|
protected $db;
|
||||||
@@ -50,6 +52,18 @@ class WrenchBlog extends BaseController
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function mobileBlogData($endpoint,$raw_array)
|
||||||
|
{
|
||||||
|
$res1 = $this->getCache($endpoint);
|
||||||
|
if (count($res1)==0){
|
||||||
|
$rawData = $this->apiData(0);
|
||||||
|
$res1= $rawData['payload']; //[0]['payload'];
|
||||||
|
$this->saveCache($endpoint,$res1);
|
||||||
|
}
|
||||||
|
$in =[];
|
||||||
|
return $this->respond( $this->summaryReturnData($in,$res1), 200);
|
||||||
|
}
|
||||||
|
|
||||||
public function blogData($endpoint,$raw_array)
|
public function blogData($endpoint,$raw_array)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@@ -96,6 +110,18 @@ class WrenchBlog extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
Column | Type | Collation | Nullable | Default
|
||||||
|
---------+-----------------------------+-----------+----------+---------------------------------------------
|
||||||
|
id | integer | | not null | nextval('blog_selections_id_seq'::regclass)
|
||||||
|
uid | uuid | | | uuid_generate_v4()
|
||||||
|
blog_id | integer | | not null |
|
||||||
|
title | character varying(50) | | not null |
|
||||||
|
banner | character varying(250) | | not null |
|
||||||
|
status | integer | | | 1
|
||||||
|
added | timestamp without time zone | | | now()
|
||||||
|
*/
|
||||||
|
|
||||||
$limit = isset($in['limit']) ? $in['limit']: 0;
|
$limit = isset($in['limit']) ? $in['limit']: 0;
|
||||||
if ($limit> 0){
|
if ($limit> 0){
|
||||||
|
|||||||
Reference in New Issue
Block a user