api code global jain
This commit is contained in:
40
app/Http/Controllers/Api/V1/Access/BloodGroupController.php
Normal file
40
app/Http/Controllers/Api/V1/Access/BloodGroupController.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api\V1\Access;
|
||||
|
||||
use App\Constant\Constant;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use App\Http\Controllers\Api\ApiController;
|
||||
use App\Repositories\Api\Access\BloodGroup\BloodGroupInterface as BloodGroupRepository;
|
||||
|
||||
class BloodGroupController extends ApiController
|
||||
{
|
||||
/**
|
||||
* @param BloodGroupRepository $bloodGroupRepository
|
||||
* BloodGroupController constructor.
|
||||
*
|
||||
*/
|
||||
public function __construct(BloodGroupRepository $bloodGroupRepository)
|
||||
{
|
||||
$this->bloodGroupRepository = $bloodGroupRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getBloodGroupList()
|
||||
{
|
||||
$response = [];
|
||||
|
||||
try {
|
||||
$response = $this->bloodGroupRepository->getBloodGroupList();
|
||||
$this->setStatusCode($response['status']);
|
||||
|
||||
} catch (\Exception $ex) {
|
||||
Log::error($ex);
|
||||
$this->setStatusCode(Constant::CODE_403);
|
||||
}
|
||||
|
||||
return $this->respond($response);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user