diff --git a/www-api/app/Config/RoutesV1.php b/www-api/app/Config/RoutesV1.php index 0bf6dc1d..69bf19fe 100644 --- a/www-api/app/Config/RoutesV1.php +++ b/www-api/app/Config/RoutesV1.php @@ -61,7 +61,7 @@ $routes->post('/en/wrench/api/v1/offerslist', 'WrenchApi::apigate'); $routes->post('/en/wrench/api/v1/offersresponse', 'WrenchApi::apigate'); $routes->post('/en/wrench/api/v1/activejoblist', 'WrenchApi::apigate'); -$routes->post('/en/wrench/api/v1/loadprofile', 'WrenchApi::apigate'); +$routes->post('/en/wrench/api/v1/loadprofile', 'WrenchUser::loadProfile'); $routes->post('/en/wrench/api/v1/updateprofile', 'WrenchApi::apigate'); $routes->post('/en/wrench/api/v1/account', 'WrenchApi::apigate'); $routes->post('/en/wrench/api/v1/message', 'WrenchApi::apigate'); diff --git a/www-api/app/Controllers/WrenchUser.php b/www-api/app/Controllers/WrenchUser.php index c9666b64..ab6880a5 100644 --- a/www-api/app/Controllers/WrenchUser.php +++ b/www-api/app/Controllers/WrenchUser.php @@ -48,5 +48,25 @@ class WrenchUser extends BaseController return $this->respond( $this->summaryReturnData($in,$out), 200); } + + public function loadProfile() + { + $raw_json = file_get_contents('php://input'); + $in = json_decode($raw_json, true); + $in["action"] = WRENCHBOARD_MOBILE_LOADPROFILE; + $out = []; + $endpoint = "WRENCHBOARD_MOBILE_LOADPROFILE-" . $in["client_uid"]; + + $out = $this->getCache($endpoint); + if (count($out) == 0) { + $ret = $this->wrenchboard->wrenchboard_api($in, $out); + $this->saveCache($endpoint, $out, 1500); + $out['internal_return'] = $ret; + log_message('critical', "***** ***** WrenchJobs::loadProfile Cache Done:::Ret " . $ret); + } + log_message('critical', "***** ***** WrenchJobs::loadProfile Ret "); + return $this->respond($this->summaryReturnData($in, $out), 200); + } + }