uniondrug/service-client

client of micro service

Installs: 155

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:project

pkg:composer/uniondrug/service-client

1.5 2018-01-31 12:49 UTC

This package is auto-updated.

Last update: 2025-10-09 20:18:58 UTC


README

UnionDrug微服务MicroService客户端consumer

  • PHP 7.1+
  • Phalcon 3.2+

methods

  1. Restful请求服务
    1. delete(string, string, array, array)
    2. get(string, string, array)
    3. head(string, string, array)
    4. options(string, string, array, array)
    5. patch(string, string, array, array)
    6. post(string, string, array, array)
    7. put(string, string, array, array)
  2. Response结果返回
    1. withError(string, int)
    2. withList(array)
    3. withObject(array)
    4. withPaging(array, ResponsePaging)
    5. withSuccess()
public function postAction(){
    $name = 'serviceName';
    $route = 'route/action';
    $query = ["page" => 1];
    $body = ["userId" => 1, "options" => ["key" => "value"]];
    $this->serviceClient->post($name, $route, $query, $body);
}

Directory

└── vendor
    └── uniondrug
        └── service-client
            ├── src
            │   └── Client.php
            └── README.md

Composer

{
    "autoload" : {
        "psr-4" : {
            "UniondrugServiceClient\\" : "vendor/uniondrug/service-client/src"
        }
    }
}