diff --git a/www-api/app/Config/RoutesV1.php b/www-api/app/Config/RoutesV1.php index cc8d466a..0ef2a24d 100644 --- a/www-api/app/Config/RoutesV1.php +++ b/www-api/app/Config/RoutesV1.php @@ -109,7 +109,7 @@ $routes->post('/en/wrench/api/v1/familywallet', 'WrenchWal $routes->post('/en/wrench/api/v1/familyresources', 'WrenchResources::familyresources'); $routes->post('/en/wrench/api/v1/commonmedia', 'WrenchResources::commonmedia'); -$routes->post('/en/wrench/api/v1/familybanners', 'WrenchBanners::apigate'); // class WrenchBanners WrenchApi +$routes->post('/en/wrench/api/v1/familybanners', 'WrenchBanners::familyBanners'); // class WrenchBanners WrenchApi $routes->post('/en/wrench/api/v1/familyrewardhx', 'WrenchApi::apigate'); $routes->post('/en/wrench/api/v1/familytransferstart', 'WrenchApi::apigate'); diff --git a/www-api/app/Controllers/WrenchBanners.php b/www-api/app/Controllers/WrenchBanners.php index 7acdb835..4e3f333f 100644 --- a/www-api/app/Controllers/WrenchBanners.php +++ b/www-api/app/Controllers/WrenchBanners.php @@ -12,6 +12,31 @@ class WrenchBanners extends BaseController { return []; } +/* + { + "action": 11200, + "member_id": "379", + "uid": "5c2f7660-2214-4c75-98b0-12e44c0d7e78", + "sessionid": "800EBCB2C336A6954BB4FA589988092434B6221CBCCF9E1D92F09D9E10CA77AC", + "limit": 30, + "offset": 0 +} + */ + public function familyBanners(){ + + $raw_json = file_get_contents('php://input'); + $in = json_decode($raw_json, true); + + // $in["action"] = WRENCHBOARD_ACCOUNT_LOGIN; + $endpoint = "FAMILY_BANNERS-". $in["uid"]; // str_pad($in["uid"], 12, "0", STR_PAD_LEFT); + $out = $this->getCache($endpoint); // try find in cache + if ( count($out) == 0 ){ + $local_url = "http://".$this->micro_service_net1.":3032/familybanners"; + $out = $this->APIcall('GET', $local_url, $in); + $this->saveCache($endpoint,$out,1500); + } + return $this->summaryReturnData($in,$out); //json_encode( $final_out ); + } public function apigate(){ log_message('critical', "0001");