+ Add Mobiblebackendtest routes
+ Update walletService routes
This commit is contained in:
parent
21cdf17c91
commit
ede547ca5f
|
@ -19,6 +19,7 @@ CACHE_DRIVER=file
|
|||
QUEUE_CONNECTION=sync
|
||||
|
||||
MOBILEBACKEND_BASE_URL =https://ilink-app.com
|
||||
MOBILEBACKENDTEST_BASE_URL=http://test.ilink-app.com:8080
|
||||
WALLET_SERVICE_BASE_URL =https://ilink-app.com
|
||||
WALLET_SERVICE_NAME = walletService
|
||||
WALLET_SERVICE_KEY=yhSTSSqIO1uSE1icu09edPOeSFGxIDjo
|
||||
|
|
|
@ -87,10 +87,14 @@ class Handler extends ExceptionHandler
|
|||
|
||||
if ( $exception instanceof ClientException)
|
||||
{
|
||||
$message = $exception->getResponse()->getBody();
|
||||
$message = $exception->getMessage();
|
||||
$array = explode("\n", $message);
|
||||
$error =json_decode($array[1]) ;
|
||||
$code = $exception->getCode();
|
||||
|
||||
return $this->errorResponse($message,$code);
|
||||
if($error)
|
||||
return $this->errorResponse($error->error,$code);
|
||||
else
|
||||
return $this->errorResponse($message,$code);
|
||||
}
|
||||
|
||||
if($exception instanceof AuthenticationException)
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Services\MobileBackendTestService;
|
||||
use App\Traits\ApiResponser;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class MobileBackendTestController extends Controller
|
||||
{
|
||||
use ApiResponser;
|
||||
/**
|
||||
* @var MobileBackendTestService
|
||||
*/
|
||||
public $mobilebackendtestService;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @param MobileBackendTestService $mobilebackendtestService
|
||||
*/
|
||||
public function __construct(MobileBackendTestService $mobilebackendtestService)
|
||||
{
|
||||
$this->mobilebackendtestService = $mobilebackendtestService;
|
||||
}
|
||||
|
||||
public function action(Request $request)
|
||||
{
|
||||
return $this->successResponse($this->mobilebackendtestService->action(
|
||||
$request->getRequestUri(), $request->all()
|
||||
));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
|
||||
use App\Traits\ConsumesExternalService;
|
||||
|
||||
class MobileBackendTestService
|
||||
{
|
||||
use ConsumesExternalService;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
public $baseUri ;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->baseUri = config('services.mobilebackendtest.base_uri');
|
||||
}
|
||||
|
||||
public function action($uri , $data)
|
||||
{
|
||||
return $this->perfomRequest('POST',$uri.'.php',$data);
|
||||
}
|
||||
}
|
|
@ -4,6 +4,9 @@ return [
|
|||
'mobilebackend' => [
|
||||
'base_uri' => env('MOBILEBACKEND_BASE_URL'),
|
||||
],
|
||||
'mobilebackendtest' => [
|
||||
'base_uri' => env('MOBILEBACKENDTEST_BASE_URL'),
|
||||
],
|
||||
'wallet_service' => [
|
||||
'base_uri' => env('WALLET_SERVICE_BASE_URL'),
|
||||
'key'=> env('WALLET_SERVICE_KEY')
|
||||
|
|
|
@ -36,14 +36,14 @@
|
|||
*/
|
||||
$router->group(['prefix' => '/mobilebackendtest/interacted' , 'middleware' => 'auth:api'], function () use ($router){
|
||||
|
||||
$router->post('LoginAction', 'MobileBackendController@action');
|
||||
$router->post('BalanceAction', 'MobileBackendController@action');
|
||||
$router->post('ConfigAction', 'MobileBackendController@action');
|
||||
$router->post('DemandeAction', 'MobileBackendController@action');
|
||||
$router->post('MembersAction', 'MobileBackendController@action');
|
||||
$router->post('LocationAction', 'MobileBackendController@action');
|
||||
$router->post('NetworkAction', 'MobileBackendController@action');
|
||||
$router->post('WalletAction', 'MobileBackendController@action');
|
||||
$router->post('LoginAction', 'MobileBackendTestController@action');
|
||||
$router->post('BalanceAction', 'MobileBackendTestController@action');
|
||||
$router->post('ConfigAction', 'MobileBackendTestController@action');
|
||||
$router->post('DemandeAction', 'MobileBackendTestController@action');
|
||||
$router->post('MembersAction', 'MobileBackendTestController@action');
|
||||
$router->post('LocationAction', 'MobileBackendTestController@action');
|
||||
$router->post('NetworkAction', 'MobileBackendTestController@action');
|
||||
$router->post('WalletAction', 'MobileBackendTestController@action');
|
||||
|
||||
});
|
||||
|
||||
|
@ -54,16 +54,17 @@
|
|||
|
||||
// Transactions routes
|
||||
$router->group(['prefix' => '/transactions'] , function () use ($router){
|
||||
$router->post('','WalletControllerr@post');
|
||||
$router->post('','WalletController@post');
|
||||
$router->get('{id_wallet}','WalletController@get');
|
||||
});
|
||||
|
||||
// Credits routes
|
||||
$router->group(['prefix' => '/credits'] , function () use ($router){
|
||||
$router->put('treatDemand/{id_demand}','WalletController@put');
|
||||
$router->put('cancelDemand/{id_demand}','WalletController@put');
|
||||
});
|
||||
|
||||
$router->post('/virement','WalletController@post');
|
||||
$router->put('/virement/{id_wallet}','WalletController@put');
|
||||
|
||||
// Wallets routes
|
||||
$router->group(['prefix' => '/wallets'] , function () use ($router){
|
||||
|
|
Loading…
Reference in New Issue