From 257d92a97bce0e91e9db371b3c247909589aa5dd Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Tue, 9 Jul 2024 12:58:39 -0400 Subject: [PATCH] WrenchJobs::sendJobInterest --- www-api/app/Config/Routes.php | 2 +- www-api/app/Controllers/WrenchJobs.php | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/www-api/app/Config/Routes.php b/www-api/app/Config/Routes.php index fb3b41f9..e2b76f70 100644 --- a/www-api/app/Config/Routes.php +++ b/www-api/app/Config/Routes.php @@ -204,7 +204,7 @@ $routes->post('/en/wrench/api/v1/uploads', 'WrenchApi::apigate'); $routes->post('/en/wrench/api/v1/myfiles', 'WrenchApi::apigate'); $routes->post('/en/wrench/api/v1/marketmessage', 'WrenchApi::apigate'); -$routes->post('/en/wrench/api/v1/marketinterest', 'WrenchApi::apigate'); +$routes->post('/en/wrench/api/v1/marketinterest', ' WrenchJobs::sendJobInterest'); //'WrenchApi::apigate' $routes->post('/en/wrench/api/v1/activejobstatus', 'WrenchApi::apigate'); $routes->post('/en/wrench/api/v1/activetaskstatus', 'WrenchApi::apigate'); diff --git a/www-api/app/Controllers/WrenchJobs.php b/www-api/app/Controllers/WrenchJobs.php index 3c1ec3d8..7cf83389 100644 --- a/www-api/app/Controllers/WrenchJobs.php +++ b/www-api/app/Controllers/WrenchJobs.php @@ -95,6 +95,27 @@ class WrenchJobs extends BaseController } */ + + public function sendJobInterest(){ + $raw_json = file_get_contents('php://input'); + $in = json_decode($raw_json, true); + $in["action"] = WRENCHBOARD_JOB_SEND_INTEREST; + $out=[]; + + $ret = $this->wrenchboard->wrenchboard_api($in, $out); + $out['internal_return'] = $ret; + log_message('critical', "***** ***** WrenchJobs::sendJobInterest Ret = ".$ret ); + if ( isset($out['internal_return']) + && $out["internal_return"] > 0 + && isset( $out['offer_code']) ){ + $endpoint = "INTEREST_MSG_".$in["offer_code"]."-". $out["member_id"]; + log_message('critical', "***** ***** WrenchJobs::sendJobInterest INTEREST_MSG_ = ".$endpoint ); + $this->saveCache($endpoint,$out,25000); + $local_url = "http://".$this->micro_service_net1.":3030/eventInterest"; + $outX = $this->APIcall('POST', $local_url, ["message"=>$out]); + } + return $this->respond( $this->summaryReturnData($in,$out), 200); + } public function assignTask(){ $raw_json = file_get_contents('php://input');