diff --git a/www-api/app/Config/RoutesV1.php b/www-api/app/Config/RoutesV1.php index 221d5d6f..1b43ec88 100644 --- a/www-api/app/Config/RoutesV1.php +++ b/www-api/app/Config/RoutesV1.php @@ -133,7 +133,7 @@ $routes->post('/en/wrench/api/v1/connectmembers', 'WrenchFamily::familyCon $routes->post('/en/wrench/api/v1/connectinvite', 'WrenchFamily::familyConnectInvite'); -$routes->post('/en/wrench/api/v1/familyrewardhx', 'WrenchApi::apigate'); +$routes->post('/en/wrench/api/v1/familyrewardhx', 'WrenchFamily::familyRewardHx'); // WrenchApi::apigate $routes->post('/en/wrench/api/v1/familytransferstart', 'WrenchApi::apigate'); $routes->post('/en/wrench/api/v1/familytransfer', 'WrenchApi::apigate'); diff --git a/www-api/app/Controllers/WrenchFamily.php b/www-api/app/Controllers/WrenchFamily.php index e7cd4c6a..c15a3ae8 100644 --- a/www-api/app/Controllers/WrenchFamily.php +++ b/www-api/app/Controllers/WrenchFamily.php @@ -144,5 +144,21 @@ class WrenchFamily extends BaseController } return $this->summaryReturnData($in,$out); //json_encode( $final_out ); } - //familysampletasks + + + public function familyRewardHx(){ + + $raw_json = file_get_contents('php://input'); + $in = json_decode($raw_json, true); + + $in["action"] = WRENCHBOARD_FAMILY_TRANSFERHX; + $endpoint = "FAMILY_REWARD_HX-". $in["uid"]; // str_pad($in["uid"], 12, "0", STR_PAD_LEFT); + $out = $this->getCache($endpoint); // try find in cache + if ( count($out) == 0 ){ + $ret = $this->wrenchboard->wrenchboard_api($in, $out); + $out['internal_return'] = $ret; + $this->saveCache($endpoint,$out,1000); + } + return $this->summaryReturnData($in,$out); //json_encode( $final_out ); + } } \ No newline at end of file