From 4110880828a9febd6b83d202ccdf6cca8bf0aa19 Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Tue, 15 Jul 2025 15:04:43 +0530 Subject: [PATCH] FEAT_LOG_HR_ACTIVITY : RV --- app/Config/Database.php | 14 ++++++++++++++ app/Config/Routes.php | 3 +++ app/Controllers/RestAuthenticationController.php | 11 +++++++++++ 3 files changed, 28 insertions(+) diff --git a/app/Config/Database.php b/app/Config/Database.php index 388b1b0..f59b49f 100755 --- a/app/Config/Database.php +++ b/app/Config/Database.php @@ -71,6 +71,20 @@ class Database extends Config 'busyTimeout' => 1000, ]; + public $postDB = [ + 'DSN' => '', + 'hostname' => 'localhost', + 'username' => 'root', + 'password' => 'root', + 'database' => 'other_db', + 'DBDriver' => 'MySQLi', + 'DBPrefix' => '', + 'pConnect' => false, + 'DBDebug' => (ENVIRONMENT !== 'production'), + 'charset' => 'utf8', + 'DBCollat' => 'utf8_general_ci', + ]; + public function __construct() { parent::__construct(); diff --git a/app/Config/Routes.php b/app/Config/Routes.php index b19ad2e..b6cfa39 100755 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -490,6 +490,8 @@ $routes->group("employeeRest", ["filter" => "authJWT"], function ($routes) { $routes->get("getEmployeeActiveOrInactivePolicy", "EmployeeRestController::getEmployeeActiveOrInactivePolicy"); $routes->get("getFEContent", "EmployeeRestController::getFEContent"); $routes->get("getAdvertisementImage", "EmployeeRestController::getAdvertisementImage"); + $routes->post("logHrActivity", "RestAuthenticationController::logHrActivity"); + }); $routes->get("getEmployeeActiveOrInactivePolicy", "EmployeeRestController::getEmployeeActiveOrInactivePolicy"); $routes->get("sendPushNotification", "EmployeeRestController::sendPushNotification"); @@ -510,3 +512,4 @@ $routes->post("addEmployeeAndDependence", "EmployeeRestController::addEmployeeAn $routes->post("getPreEmployeePolicyCount", "EmployeeRestController::getPreEmployeePolicyCount"); + diff --git a/app/Controllers/RestAuthenticationController.php b/app/Controllers/RestAuthenticationController.php index b711005..d3441dc 100755 --- a/app/Controllers/RestAuthenticationController.php +++ b/app/Controllers/RestAuthenticationController.php @@ -1019,4 +1019,15 @@ class RestAuthenticationController extends AdminController ], 500); } } + + public function logHrActivity() + { + $log_data = $this->request->getJSON(); + $postDB = \Config\Database::connect('postDB'); + // print_r($json);die(); + $postDB->table('user_activity_history')->insert($log_data); + return $this->respond(['status' => 'success','code' => 200,'data' => "logged",],200); + + } + } \ No newline at end of file