mirror of
https://gitlab.com/izyim/prototypes/lumen-microservices/microservice-api-gateway.git
synced 2026-08-25 23:44:21 +00:00
initial commit
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Traits\RequestService;
|
||||
|
||||
class OrderService
|
||||
{
|
||||
use RequestService;
|
||||
|
||||
public $baseUri;
|
||||
public $secret;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->baseUri = config('services.orders.base_uri');
|
||||
$this->secret = config('services.orders.secret');
|
||||
}
|
||||
|
||||
public function fetchOrders()
|
||||
{
|
||||
return $this->request('GET', '/api/order');
|
||||
}
|
||||
|
||||
public function fetchOrder($order)
|
||||
{
|
||||
return $this->request('GET', "/api/order/{$order}");
|
||||
}
|
||||
|
||||
public function createOrder($data)
|
||||
{
|
||||
return $this->request('POST', '/api/order', $data);
|
||||
}
|
||||
|
||||
public function updateOrder($order, $data)
|
||||
{
|
||||
return $this->request('PATCH', "/api/order/{$order}", $data);
|
||||
}
|
||||
|
||||
public function deleteOrder($order)
|
||||
{
|
||||
return $this->request('DELETE', "/api/order/{$order}");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user