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
README
UnionDrug微服务
MicroService客户端consumer。
- PHP
7.1+ - Phalcon
3.2+
methods
- Restful请求服务
delete(string,string,array,array)get(string,string,array)head(string,string,array)options(string,string,array,array)patch(string,string,array,array)post(string,string,array,array)put(string,string,array,array)
- Response结果返回
withError(string,int)withList(array)withObject(array)withPaging(array,ResponsePaging)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"
}
}
}