From e703e093abedd59e2f96ccfca99a44b68e2f1b1f Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Thu, 19 Sep 2024 10:25:41 -0400 Subject: [PATCH] promo end point --- www-api/app/Config/RoutesV1.php | 3 +++ www-api/app/Controllers/Promo.php | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/www-api/app/Config/RoutesV1.php b/www-api/app/Config/RoutesV1.php index 48bc073b..b88f192b 100644 --- a/www-api/app/Config/RoutesV1.php +++ b/www-api/app/Config/RoutesV1.php @@ -7,6 +7,9 @@ $routes->get('/', 'Home::index'); $routes->get('/en/wrench/api/v1/test','Home::test'); + +$routes->post('/en/wrench/api/v1/promoverify', 'Promo::promoVerify'); + $routes->post('/en/wrench/api/v1/playground', 'WrenchPlayGround::apigate'); $routes->post('/en/wrench/api/v1/authlogin', 'WrenchOauth::apigate'); diff --git a/www-api/app/Controllers/Promo.php b/www-api/app/Controllers/Promo.php index 67a9ab48..a58e33b6 100644 --- a/www-api/app/Controllers/Promo.php +++ b/www-api/app/Controllers/Promo.php @@ -20,7 +20,7 @@ class Promo extends BaseController // $in["promo"] = $promo; // $in["promo_owner"] = $promoOwner; - log_message('critical', "promoStart::promoStart ********* ALL ".serialize($in) ); + log_message('critical', "Promo::promoStart ********* ALL ".serialize($in) ); $in["loc"] = $_SERVER["REMOTE_ADDR"]; $in['limit'] = 10; // $out["firstname"] = "Firstname"; @@ -34,6 +34,16 @@ class Promo extends BaseController return $this->respond( $this->summaryReturnData($in,$out), 200); } + public function promoVerify(){ + $raw_json = file_get_contents('php://input'); + $in = json_decode($raw_json, true); + $in["action"] = -1; // bad number - we dont want formating WRENCHBOARD_ACCOUNT_JOBLIST; dont send this line , the formater will be confused + $out=[]; + + + log_message('critical', "***** ***** Promo::promoVerify Ret "); + return $this->respond( $this->summaryReturnData($in,$out), 200); + } public function promoTask(){ $raw_json = file_get_contents('php://input'); @@ -56,14 +66,14 @@ class Promo extends BaseController $this->saveCache($endpoint,$out,3000); } $out['internal_return'] = 0; // just backwad comaptobility - log_message('critical', "***** ***** WrenchJobs::getJobsData Cache Done:::Ret "); + log_message('critical', "***** ***** Promo::getJobsData Cache Done:::Ret "); } $endpoint = "WRENCH_JOB_INTEREST_COUNT"; $int_list = $this->getCache($endpoint)["result_list"]; $out["interest_list"] = ( isset($int_list) && is_array($int_list) ) ? $int_list : []; - log_message('critical', "***** ***** WrenchJobs::getJobsData Ret "); + log_message('critical', "***** ***** Promo::getJobsData Ret "); return $this->respond( $this->summaryReturnData($in,$out), 200); }