This commit is contained in:
2022-06-20 10:04:49 -04:00
parent 61e57863c5
commit a57b701fd9
5 changed files with 217 additions and 7 deletions
+79 -3
View File
@@ -31,7 +31,13 @@ $endpoints = array(
'taskmessage' => array('POST'),
'sendtaskmessage' => array('POST'),
'getwallets' => array('POST'),
'sitecontact' => array('POST')
'sitecontact' => array('POST'),
'signupcountry' => array('POST'),
'userscards' => array('POST'),
'blogdata' => array('POST'),
'blogitem' => array('POST'),
'couponhx' => array('POST'),
'couponpending' => array('POST'),
);
$call_backend = true; // sometimes we need to overwite the call to the extenstion API
@@ -94,8 +100,77 @@ if ($_SERVER["REQUEST_METHOD"] == "GET") {
}
$in["loc"] = $_SERVER["REMOTE_ADDR"];
switch ($endpoint) {
case 'couponpending':
$in["action"] = WRENCHBOARD_COUPON_PENDLIST;
break;
case 'couponhx':
$in["action"] = WRENCHBOARD_COUPON_MEMLIST;
break;
case 'signupcountry':
$local_out = [
'result'=>'100',
'signup_country'=>[
['NG', 'Nigeria'],
['US', 'United States']
]
];
$call_backend = false;
break;
case 'blogitem':
$blogData = getBlogItem();
$local_out = [
'result'=>'100',
'blog_data'=> $blogData
];
$call_backend = false;
break;
case 'blogdata':
$blogData = getBlogData();
$local_out = [
'result'=>'100',
'blog_data'=> $blogData
];
$call_backend = false;
break;
case 'userscards':
$local_out = [
'result'=>'100',
'result_list'=>[
['title'=>'This is your coupon',
'description'=>'This is the description of the description',
'card_type'=>'COUPON',
'card_style' =>'card1',
'card_icon' =>'icon1',
'assign_id'=> 0,
'Nigeria'],
['title'=>'A Recommended Story',
'description'=>'This is the description of the description',
'card_type'=>'BLOG',
'card_style' =>'card2',
'card_icon' =>'icon1',
'assign_id'=> 0,
'United States'],
['title'=>'You have a new task sent to you',
'description'=>'This is the description of the description',
'card_type'=>'NEWTASK',
'card_style' =>'card1',
'card_icon' =>'icon1',
'assign_id'=> 0,
'United States'],
['title'=>'You just Earned some token',
'description'=>'This is the description of the description',
'card_type'=>'TOKEN',
'card_style' =>'card2',
'card_icon' =>'icon1',
'assign_id'=> 0,
'United States']
]
];
$call_backend = false;
break;
case 'sitecontact':
$local_out = ['result'=>'100','msg'=>'Recieved'];
$local_out = ['result'=>'100','msg'=>'Received'];
$call_backend = false;
break;
case 'generics':
@@ -188,7 +263,7 @@ $in["pid"] = 100;
$out = array();
if ( $call_backend == true){
$ret = $wrenchboard->wrenchboard_api($in, $out);
$out['internal_return'] = $ret; // this is reserved array parameter - to be caprured and reoved before you use the out array()
$out['internal_return'] = $ret; // this is reserved array parameter - to be captured and received before you use the out array()
}
else
{
@@ -214,4 +289,5 @@ function flatten($data, $parentkey = "") {
return $result;
}
// vi:ts=2