diff --git a/.env b/.env index db7f9d7..0990a8d 100644 --- a/.env +++ b/.env @@ -33,13 +33,13 @@ app.assetBaseURL = 'https://project.adhivasindo.co.id/api_tambang_ntb/' # DATABASE #-------------------------------------------------------------------- -database.default.hostname = localhost -database.default.database = stock_map -database.default.username = postgres -database.default.password = yoga21 -database.default.DBDriver = Postgre -database.default.DBPrefix = -database.default.port = 5432 +database.postgre.hostname = localhost +database.postgre.database = stock_map +database.postgre.username = postgres +database.postgre.password = yoga21 +database.postgre.DBDriver = Postgre +database.postgre.DBPrefix = +database.postgre.port = 5432 # database.tests.hostname = localhost # database.tests.database = ci4_test diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 59aa5bf..dd51779 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -2,31 +2,24 @@ use Dhiva\Core\DhivaRoutes; -$routes->set404Override('App\Controllers\RoutesController::notfound'); - // Dev/Health Check $routes->get('/', 'DevController::sukses'); $routes->get('/sukses', 'DevController::sukses'); -$routes->get('testdb', 'TestDb::test'); -// Authentication & Profile -$routes->post('auth', 'SuperUserController::auth'); -$routes->get('logout', 'SuperUserController::logout'); -$routes->get('profile', 'SuperUserController::getProfile'); -$routes->post('update-profile', 'SuperUserController::updateProfile'); -$routes->post('update-password', 'SuperUserController::updatePassword'); +// API Routes Group +$routes->group('api', function($routes) { + // Authentication & Profile + $routes->post('auth', 'SuperUserController::auth'); + $routes->get('logout', 'SuperUserController::logout'); + $routes->get('profile', 'SuperUserController::getProfile'); + $routes->post('update-profile', 'SuperUserController::updateProfile'); + $routes->post('update-password', 'SuperUserController::updatePassword'); -// Personel & DRH (New Features) -$routes->get('personel/profil', 'PersonelController::getProfil'); -$routes->get('personel/drh', 'PersonelController::getDaftarRiwayatHidup'); -$routes->post('personel/generate-link', 'PersonelController::generateEncryptedLink'); - -// Legacy / Other (Keep if needed by other components, otherwise clean up) -// For now, I'll keep the ones the user didn't explicitly ask to remove, -// but focused on the core requested cleanup. -// $routes->post('auth/v2', 'SuperUserController::authV2'); -// $routes->get('getfoto', 'SuperUserController::getfoto'); -// $routes->get('token', 'SuperUserController::cekToken'); - -// Standard CRUD via DhivaRoutes (Keep for compatibility) -DhivaRoutes::Route($routes, 'user', 'SuperUserController'); \ No newline at end of file + // Personel & DRH (New Features) + $routes->get('personel/profil', 'PersonelController::getProfil'); + $routes->get('personel/drh', 'PersonelController::getDaftarRiwayatHidup'); + $routes->post('personel/generate-link', 'PersonelController::generateEncryptedLink'); + + // Standard CRUD via DhivaRoutes (Keep for compatibility) + DhivaRoutes::Route($routes, 'user', 'SuperUserController'); +}); \ No newline at end of file diff --git a/app/Controllers/BaseController.php b/app/Controllers/BaseController.php index db32e76..f13bddc 100644 --- a/app/Controllers/BaseController.php +++ b/app/Controllers/BaseController.php @@ -155,27 +155,28 @@ abstract class BaseController extends Controller public function initControllers() { $bypassed = [ - '/auth' => 'POST', - '/auth/v2' => 'POST', - '/user' => 'POST', - '/user-verifications/request-otp' => 'POST', - '/user-verifications/verification-otp-code' => 'POST', - '/user-verifications/resend-otp-code' => 'POST', - '/user-verifications/upload-face-photos' => 'POST', - '/forgot-password' => 'POST', - '/reset-password' => 'POST', - '/pelanggaran/feedback' => 'POST', - '/list-pelanggaran' => 'GET', - '/pelanggaran/get-feedback-by-id' => 'POST', - '/pencarian-pelanggaran-2' => 'POST', - '/check-bypass-liveness' => 'GET', - '/koperasi' => 'GET', - '/koperasi/' => 'GET', - '/get-distribusi-shu-mingguan/' => 'GET', - '/get-distribusi-shu-mingguan' => 'GET', - '/live-gold-price' => 'GET', - '/update-profile' => 'POST', - '/profile' => 'GET', + '/api/auth' => 'POST', + '/api/auth/v2' => 'POST', + '/api/user' => 'POST', + '/api/user-verifications/request-otp' => 'POST', + '/api/user-verifications/verification-otp-code' => 'POST', + '/api/user-verifications/resend-otp-code' => 'POST', + '/api/user-verifications/upload-face-photos' => 'POST', + '/api/forgot-password' => 'POST', + '/api/reset-password' => 'POST', + '/api/pelanggaran/feedback' => 'POST', + '/api/list-pelanggaran' => 'GET', + '/api/pelanggaran/get-feedback-by-id' => 'POST', + '/api/pencarian-pelanggaran-2' => 'POST', + '/api/check-bypass-liveness' => 'GET', + '/api/koperasi' => 'GET', + '/api/koperasi/' => 'GET', + '/api/get-distribusi-shu-mingguan/' => 'GET', + '/api/get-distribusi-shu-mingguan' => 'GET', + '/api/live-gold-price' => 'GET', + '/api/update-profile' => 'POST', + '/api/profile' => 'GET', + '/api/personel/profil' => 'GET', ]; $publickey = ''; diff --git a/app/Controllers/PersonelController.php b/app/Controllers/PersonelController.php index 8deadfb..0b064be 100644 --- a/app/Controllers/PersonelController.php +++ b/app/Controllers/PersonelController.php @@ -3,6 +3,7 @@ namespace App\Controllers; use App\Models\PersonelModel; +use Dhiva\Core\DhivaAES; class PersonelController extends BaseController {