drinks-it/esb-client 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

drinks-it/esb-client

最新稳定版本:2.31

Composer 安装命令:

composer require drinks-it/esb-client

包简介

ESB client.

关键字:

README 文档

README

A PHP client library for interacting with an ESB (Enterprise Service Bus) API. This library provides a set of request classes and a configurable API client for seamless integration with various ESB endpoints.

Features

  • Simple API client for ESB integration
  • Request classes for different ESB operations (orders, products, reports, etc.)
  • Factory pattern for client instantiation
  • Guzzle HTTP client support

Requirements

  • PHP 7.4 or higher
  • Composer

Installation

Install via Composer:

composer require your-vendor/esb-client

Usage

Basic Example

use EsbClient\ApiClient;
use EsbClient\ApiConfig;
use EsbClient\Request\OrderRequest;

$config = new ApiConfig([
    'base_uri' => 'https://api.example.com',
    'api_key' => 'your-api-key',
]);

$client = new ApiClient($config);

$request = new OrderRequest(/* ...parameters... */);
$response = $client->send($request);

// Handle $response

Using the Factory

use EsbClient\Factory\EsbClientFactory;

$client = EsbClientFactory::create([
    'base_uri' => 'https://api.example.com',
    'api_key' => 'your-api-key',
]);

Project Structure

  • src/ApiClient.php - Main API client class
  • src/ApiConfig.php - API configuration
  • src/Factory/ - Factories for client and HTTP client
  • src/Request/ - Request classes for various ESB operations

Extending

You can add new request types by creating new classes in the src/Request/ directory, following the existing request class structure.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

统计信息

  • 总下载量: 5.14k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-03-23