GWM : master api
This commit is contained in:
parent
3765f45ed5
commit
f8ed1acae4
@ -8,6 +8,8 @@ use CodeIgniter\Router\RouteCollection;
|
||||
$routes->get('swagger', 'SwaggerController::view');
|
||||
$routes->get('swagger/json', 'SwaggerController::generate');
|
||||
|
||||
$routes->get('app_test', 'MasterController::app_test');
|
||||
|
||||
//Auth
|
||||
$routes->group('api', ['filter' => 'appSignature'], function ($routes) {
|
||||
|
||||
@ -30,6 +32,8 @@ $routes->group('api', ['filter' => 'appSignature'], function ($routes) {
|
||||
|
||||
//Master
|
||||
$routes->get('master/getRoleMaster', 'MasterController::getRoleMaster');
|
||||
$routes->get('master/getVehicleTypeMaster', 'MasterController::getVehicleTypeMaster');
|
||||
$routes->get('master/getInsurancePlanTypeMaster', 'MasterController::getInsurancePlanTypeMaster');
|
||||
|
||||
//Agent
|
||||
$routes->get('agent/agentList', 'AgentController::agentList');
|
||||
|
||||
@ -4,6 +4,8 @@ namespace App\Controllers;
|
||||
|
||||
use CodeIgniter\RESTful\ResourceController;
|
||||
use App\Models\RoleMasterModel;
|
||||
use App\Models\VehicleTypeMasterModel;
|
||||
use App\Models\InsurancePlanTypeMasterModel;
|
||||
|
||||
|
||||
class MasterController extends ResourceController
|
||||
@ -11,15 +13,25 @@ class MasterController extends ResourceController
|
||||
protected $format = 'json';
|
||||
protected $myLogger;
|
||||
protected $RoleMasterModel;
|
||||
protected $VehicleTypeMasterModel;
|
||||
protected $InsurancePlanTypeMasterModel;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->myLogger = \Config\Services::mylogger();
|
||||
$this->RoleMasterModel = new RoleMasterModel();
|
||||
$this->VehicleTypeMasterModel = new VehicleTypeMasterModel();
|
||||
$this->InsurancePlanTypeMasterModel = new InsurancePlanTypeMasterModel();
|
||||
|
||||
}
|
||||
|
||||
public function app_test()
|
||||
{
|
||||
|
||||
return $this->respond(['status' => 200,'message' => 'success','data' => []]);
|
||||
}
|
||||
|
||||
|
||||
public function getRoleMaster()
|
||||
{
|
||||
@ -32,6 +44,28 @@ class MasterController extends ResourceController
|
||||
return $this->respond(['status' => 200,'message' => 'success','data' => $data]);
|
||||
}
|
||||
|
||||
public function getVehicleTypeMaster()
|
||||
{
|
||||
$data = $this->VehicleTypeMasterModel->findAll();
|
||||
|
||||
if (!$data) {
|
||||
return $this->failNotFound('No data found');
|
||||
}
|
||||
|
||||
return $this->respond(['status' => 200,'message' => 'success','data' => $data]);
|
||||
}
|
||||
|
||||
public function getInsurancePlanTypeMaster()
|
||||
{
|
||||
$data = $this->InsurancePlanTypeMasterModel->findAll();
|
||||
|
||||
if (!$data) {
|
||||
return $this->failNotFound('No data found');
|
||||
}
|
||||
|
||||
return $this->respond(['status' => 200,'message' => 'success','data' => $data]);
|
||||
}
|
||||
|
||||
|
||||
// public function getTravelStatusMaster()
|
||||
// {
|
||||
|
||||
21
app/Models/InsurancePlanTypeMasterModel.php
Normal file
21
app/Models/InsurancePlanTypeMasterModel.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class InsurancePlanTypeMasterModel extends Model
|
||||
{
|
||||
protected $table = 'partner_insurance_plan_type_master';
|
||||
protected $primaryKey = 'id';
|
||||
protected $allowedFields = [
|
||||
'insurance_plan_type',
|
||||
'is_active',
|
||||
'created_by',
|
||||
'created_on',
|
||||
'updated_by',
|
||||
'updated_on'
|
||||
];
|
||||
|
||||
protected $useTimestamps = false; // created_on & updated_on handled by DB
|
||||
}
|
||||
21
app/Models/VehicleTypeMasterModel.php
Normal file
21
app/Models/VehicleTypeMasterModel.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class VehicleTypeMasterModel extends Model
|
||||
{
|
||||
protected $table = 'partner_vehicle_type_master';
|
||||
protected $primaryKey = 'id';
|
||||
protected $allowedFields = [
|
||||
'vehicle_type',
|
||||
'is_active',
|
||||
'created_by',
|
||||
'created_on',
|
||||
'updated_by',
|
||||
'updated_on'
|
||||
];
|
||||
|
||||
protected $useTimestamps = false; // we handle created_on & updated_on manually
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user