From afcc1b777f5cd46ec0f73b3390bdd8253de42326 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Wed, 11 Sep 2024 22:39:22 -0400 Subject: [PATCH] banners start --- wrenchboard/src/shared_tool/site_crons.cc | 23 ++++++++++++++--------- www-api/app/Config/RoutesV1.php | 2 +- www-api/app/Controllers/WrenchBanners.php | 15 +++++++++++++++ 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/wrenchboard/src/shared_tool/site_crons.cc b/wrenchboard/src/shared_tool/site_crons.cc index 7455a204..d03cf70f 100644 --- a/wrenchboard/src/shared_tool/site_crons.cc +++ b/wrenchboard/src/shared_tool/site_crons.cc @@ -187,17 +187,22 @@ long ScheduleTransferJobs(CVars in, CVars &out){ long TestNotificationsJobs(CVars in, CVars &out){ long push_ret = -1; CVars xx; - xx["member_uid"] = "70d8ecc4-490f-40e5-9cea-0484f0a9f584"; xx["member_uid"].set_valid( true ); - xx["push_text"] = "Notification test system...Olu"; xx["push_text"].set_valid( true ); - push_ret = BkoSendPush( xx, out); + try{ + xx["member_uid"] = "70d8ecc4-490f-40e5-9cea-0484f0a9f584"; xx["member_uid"].set_valid( true ); + xx["push_text"] = "Notification test system...Olu"; xx["push_text"].set_valid( true ); + push_ret = BkoSendPush( xx, out); - xx["member_uid"] = "d96607ee-37ac-458f-a57d-7f2027a9ba11"; xx["member_uid"].set_valid( true ); - xx["push_text"] = "Notification test system...Obax"; xx["push_text"].set_valid( true ); - push_ret = BkoSendPush( xx, out); + xx["member_uid"] = "d96607ee-37ac-458f-a57d-7f2027a9ba11"; xx["member_uid"].set_valid( true ); + xx["push_text"] = "Notification test system...Obax"; xx["push_text"].set_valid( true ); + push_ret = BkoSendPush( xx, out); - xx["member_uid"] = "52cee358-759f-42f5-8cfb-d3f77b323c1a"; xx["member_uid"].set_valid( true ); - xx["push_text"] = "Notification test system...Toks"; xx["push_text"].set_valid( true ); - push_ret = BkoSendPush( xx, out); + //52cee358-759f-42f5-8cfb-d3f77b323c1a + xx["member_uid"] = "52cee358-759f-42f5-8cfb-d3f77b323c1a"; xx["member_uid"].set_valid( true ); + xx["push_text"] = "Notification test system...Toks"; xx["push_text"].set_valid( true ); + push_ret = BkoSendPush( xx, out); + } catch (bad_parameter) { + logfmt(logINFO, "ERROR CALL long TestNotificationsJobs(CVars in, CVars &out)"); + } return 0; } diff --git a/www-api/app/Config/RoutesV1.php b/www-api/app/Config/RoutesV1.php index 0c9afc22..63c2a050 100644 --- a/www-api/app/Config/RoutesV1.php +++ b/www-api/app/Config/RoutesV1.php @@ -35,7 +35,7 @@ $routes->post('/en/wrench/api/v1/startresetpasword', 'WrenchAuth::passwordReset $routes->post('/en/wrench/api/v1/userlogin', 'WrenchAuth::userLogin'); // New routes defined $routes->post('/en/wrench/api/v1/qrlogin', 'WrenchAuth::qrLogin'); //'WrenchApi::apigate' -$routes->post('/en/wrench/api/v1/homebanners', 'WrenchApi::apigate'); +$routes->post('/en/wrench/api/v1/homebanners', 'WrenchBanners::usersBanners'); // 'WrenchApi::apigate' $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'); diff --git a/www-api/app/Controllers/WrenchBanners.php b/www-api/app/Controllers/WrenchBanners.php index 73cf8a94..370fc73e 100644 --- a/www-api/app/Controllers/WrenchBanners.php +++ b/www-api/app/Controllers/WrenchBanners.php @@ -40,6 +40,21 @@ class WrenchBanners extends BaseController // return $this->summaryReturnData($in,$out); //json_encode( $final_out ); // } + public function usersBanners(){ + $raw_json = file_get_contents('php://input'); + $in = json_decode($raw_json, true); + $out =[]; + $in["action"] = WRENCHBOARD_ACCOUNT_HOMEBANNERS ; + $endpoint = $in["action"]."-". $in["uuid"]; // str_pad($in["uid"], 12, "0", STR_PAD_LEFT); + $out = $this->getCache($endpoint); // try find in cache + if ( count($out) == 0 ){ + $ret = $this->wrenchboard->wrenchboard_api($in, $out); + $out['internal_return'] = $ret; + log_message('critical', "usersBanners ********* ALL ".serialize($out) ); + $this->saveCache($endpoint,$out,1500); + } + return $this->summaryReturnData($in,$out); //json_encode( $final_out ); + } public function apigate(){ log_message('critical', "0001"); header('Access-Control-Allow-Origin: *');