From f901c9056e16a6b05da0058bc50908891b7d0f91 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Mon, 4 Dec 2023 17:36:58 -0500 Subject: [PATCH] dummy help data --- www-api/app/Config/Routes.php | 2 +- www-api/app/Controllers/WrenchFaq.php | 36 +++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/www-api/app/Config/Routes.php b/www-api/app/Config/Routes.php index 06e67538..a127984c 100644 --- a/www-api/app/Config/Routes.php +++ b/www-api/app/Config/Routes.php @@ -47,7 +47,7 @@ $routes->post('/en/wrench/api/v1/authstart', 'WrenchOauth::apigate'); $routes->post('/en/wrench/api/v1/faq', 'WrenchFaq::apigate'); $routes->post('/en/wrench/api/v1/faqdata', 'WrenchFaq::apigate'); - +$routes->post('/en/wrench/api/v1/helpdata', 'WrenchFaq::apiHelpData'); $routes->post('/en/wrench/api/v1/apigate', 'WrenchApi::apigate'); $routes->post('/en/wrench/api/v1/generics', 'WrenchApi::apigate'); diff --git a/www-api/app/Controllers/WrenchFaq.php b/www-api/app/Controllers/WrenchFaq.php index 3b13e7bb..10d29c8b 100644 --- a/www-api/app/Controllers/WrenchFaq.php +++ b/www-api/app/Controllers/WrenchFaq.php @@ -141,6 +141,42 @@ class WrenchFaq extends BaseController } + public function helpgate(){ + return json_encode( $this->apiHelpData() ); + } + private function apiHelpData() { + + $total = 20; + + $data = array( + "status" => 100, + "total_record" => ($total - 1), + "internal_return" => 0, + "result_list" => array(), + ); + + + for ($i = 0; $i < $total; $i++) { + $key = sprintf("%05d", $i); + $msg=''; + $msgS = "

Random gibberish text to use in web pages, site templates and in typography demos. + Get rid of Lorem Ipsum forever. A tool for web designers who want to save time.

"; + $txL = rand(1,5); + for($ii=1; $ii<$txL; $ii++){ + $msg = $msg.$msgS; + } + + $data["result_list"][] = array( + "uid" => $key, + "public" => "1", + "title" => "This is faq title dummy text ".$key, + "vid" => (rand(0,1)> 1) ? "https://www.youtube.com/embed/xZ4o180KFNk?si=zGuIgpfTb-Tc0o3H":'', + "msg" => $msg + ); + } + + return $data; + } } \ No newline at end of file