Joba data cache

This commit is contained in:
CHIEFSOFT\ameye
2024-08-21 17:05:40 -04:00
parent 373728fda2
commit 42ea1149cc
2 changed files with 20 additions and 1 deletions
+1 -1
View File
@@ -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');
+19
View File
@@ -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);