From 47acbc436fcb7918e84188cee35c095eaac57e38 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Thu, 4 Jul 2024 20:53:52 -0400 Subject: [PATCH] New static data --- www-api/app/Config/Routes.php | 2 +- www-api/app/Controllers/BaseController.php | 13 ++++++ www-api/app/Controllers/WrenchApi.php | 13 +----- www-api/app/Controllers/WrenchGeneralData.php | 44 +++++++++++++++++++ 4 files changed, 59 insertions(+), 13 deletions(-) create mode 100644 www-api/app/Controllers/WrenchGeneralData.php diff --git a/www-api/app/Config/Routes.php b/www-api/app/Config/Routes.php index 120e77ea..a09f17c7 100644 --- a/www-api/app/Config/Routes.php +++ b/www-api/app/Config/Routes.php @@ -179,7 +179,7 @@ $routes->post('/en/wrench/api/v1/activejobmsglist', 'WrenchApi::apigate'); $routes->post('/en/wrench/api/v1/sitecontact', 'WrenchApi::apigate'); -$routes->post('/en/wrench/api/v1/signupcountry', 'WrenchApi::apigate'); +$routes->post('/en/wrench/api/v1/signupcountry', 'WrenchGeneralData::signUpCountry'); $routes->post('/en/wrench/api/v1/userscards', 'WrenchApi::apigate'); $routes->post('/en/wrench/api/v1/couponhx', 'WrenchApi::apigate'); diff --git a/www-api/app/Controllers/BaseController.php b/www-api/app/Controllers/BaseController.php index 2542c890..5c685cb1 100644 --- a/www-api/app/Controllers/BaseController.php +++ b/www-api/app/Controllers/BaseController.php @@ -433,4 +433,17 @@ abstract class BaseController extends Controller curl_close($curl); return json_decode($result, true); } + + public function familyTypes(){ + return [ + array("ty"=>"Parent", "id"=>"PARENT", "tag"=>"fam_type_parent"), + array("ty"=>"Relatives", "id"=>"RELATIVES", "tag"=>"fam_type_relatives"), + array("ty"=>"Others", "id"=>"Others", "tag"=>"fam_type_others") + ]; + } + public function historyTypes(){ + return [ + array("ty"=>"Completed Jobs", "id"=>"COMPLETED_JOBS", "tag"=>"hist_type_completed_jobs"), + ]; + } } diff --git a/www-api/app/Controllers/WrenchApi.php b/www-api/app/Controllers/WrenchApi.php index ed9da061..37f8ebef 100644 --- a/www-api/app/Controllers/WrenchApi.php +++ b/www-api/app/Controllers/WrenchApi.php @@ -725,17 +725,6 @@ class WrenchApi extends BaseController return $bannerArray; } - private function familyTypes(){ - return [ - array("ty"=>"Parent", "id"=>"PARENT", "tag"=>"fam_type_parent"), - array("ty"=>"Relatives", "id"=>"RELATIVES", "tag"=>"fam_type_relatives"), - array("ty"=>"Others", "id"=>"Others", "tag"=>"fam_type_others") - ]; - } - private function historyTypes(){ - return [ - array("ty"=>"Completed Jobs", "id"=>"COMPLETED_JOBS", "tag"=>"hist_type_completed_jobs"), - ]; - } + } diff --git a/www-api/app/Controllers/WrenchGeneralData.php b/www-api/app/Controllers/WrenchGeneralData.php new file mode 100644 index 00000000..1a003d0c --- /dev/null +++ b/www-api/app/Controllers/WrenchGeneralData.php @@ -0,0 +1,44 @@ +current_env = $this->getSiteConfigurations("system.live"); + $this->primary_image_sever = $this->getSiteConfigurations("system.primary_image_sever"); + $this->server_tag = $this->getSiteConfigurations("system.server_tag"); + } + + public function signUpCountry(){ + $in["action"] = WRENCHBOARD_SIGNUP_COUNTRY; + + + $wrenchboard = new \App\Models\BackendModel(); + $ret = $wrenchboard->wrenchboard_api($in, $out); + $out['internal_return'] = $ret; + + $endpoint = "SIGNUP_COUNTRY-"; + $this->saveCache($endpoint,$out,$timeLine=15000); + + + // $this->doCacheStep($in, $out); + $final_out = ( new \App\Models\ResultFormatter() )->processOutJson($in, $out); + $final_out["environment"] = $this->current_env + 0; + $final_out["session_image_server"] = $this->primary_image_sever; + $final_out["server_tag"] = $this->server_tag; + $final_out["language"] = "en"; + $final_out["ip_loc"] = $this->getIpData(); + $final_out["current_version"] = 20240306; + $final_out["family_types"] = $this->familyTypes(); + $final_out["history_types"] = $this->historyTypes(); + //return json_encode( ( new \App\Models\ResultFormatter() )->processOutJson($in, $out)); + return json_encode( $final_out ); + + } +} \ No newline at end of file