diff --git a/www-api/app/Config/RoutesV1.php b/www-api/app/Config/RoutesV1.php index 5d916716..4ef30706 100644 --- a/www-api/app/Config/RoutesV1.php +++ b/www-api/app/Config/RoutesV1.php @@ -40,7 +40,7 @@ $routes->post('/en/wrench/api/v1/startjoblist', 'WrenchApi::apigate'); $routes->get('/en/wrench/api/v1/startjoblist', 'WrenchApi::apigate'); $routes->post('/en/wrench/api/v1/dashdata', 'WrenchApi::apigate'); -$routes->post('/en/wrench/api/v1/getjobsdata', 'WrenchJobs::apigate'); //WrenchJobs WrenchApi +$routes->post('/en/wrench/api/v1/getjobsdata', 'WrenchJobs::getJobsData'); //WrenchJobs WrenchApi apigate $routes->post('/en/wrench/api/v1/offerslist', 'WrenchApi::apigate'); $routes->post('/en/wrench/api/v1/offersresponse', 'WrenchApi::apigate'); diff --git a/www-api/app/Controllers/WrenchJobs.php b/www-api/app/Controllers/WrenchJobs.php index 375ed2c4..82fbb0d4 100644 --- a/www-api/app/Controllers/WrenchJobs.php +++ b/www-api/app/Controllers/WrenchJobs.php @@ -12,6 +12,25 @@ class WrenchJobs extends BaseController $this->request = $request = \Config\Services::request(); } + public function getJobsData() { + $raw_json = file_get_contents('php://input'); + $in = json_decode($raw_json, true); + $in["action"] = WRENCHBOARD_ACCOUNT_JOBLIST; + $out=[]; + $endpoint = "JOB_DATA-". $in["uid"]; + + $out = $this->getCache($endpoint); + if ( count($out)==0 ){ + $local_url = "http://".$this->micro_service_net1.":3033/marketjobs"; + $out = $this->APIcall('GET', $local_url, $in); + $this->saveCache($endpoint,$out,15000); + $out['internal_return'] = 0; // just backwad comaptobility + log_message('critical', "***** ***** WrenchJobs::getJobsData Cache Done:::Ret ". $ret); + } + log_message('critical', "***** ***** WrenchJobs::getJobsData Ret "); + return $this->respond( $this->summaryReturnData($in,$out), 200); + } + public function interestStats(){ $raw_json = file_get_contents('php://input'); $in = json_decode($raw_json, true);