borzistyi / backend-service-posts-client
Posts API 服务描述
dev-master
2024-07-10 10:35 UTC
Requires
- php: ^7.1 || ^8.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2 || ^7.0
- guzzlehttp/psr7: ^1.6.1
- symfony/http-foundation: ^5.0 || ^6.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.12
- phpunit/phpunit: ^7.4 || ^8.0 || ^9.0
This package is not auto-updated.
Last update: 2024-10-03 06:59:34 UTC
README
Posts API 服务描述
此 PHP 包由 OpenAPI Generator 项目自动生成
- API 版本:1.0.0
- 构建包:org.openapitools.codegen.languages.PhpClientCodegen。更多信息,请访问 https://ensi.tech/contacts
需求
PHP 5.5 及以上版本
安装 & 使用
Composer
要使用 Composer 安装绑定,请将以下内容添加到 composer.json
{
"repositories": [
{
"type": "vcs",
"url": "https://gitlab.com/greensight/ensi/backend-service-posts-client-php.git"
}
],
"require": {
"ensi/backend-service-posts-client": "*@dev"
}
}
然后运行 composer install
手动安装
下载文件并包含 autoload.php
require_once('/path/to/BackendServicePostsClient/vendor/autoload.php');
测试
要运行单元测试
composer install
./vendor/bin/phpunit
入门
请遵循 安装说明,然后运行以下命令
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Ensi\BackendServicePostsClient\Api\PostsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$create_post_request = new \Ensi\BackendServicePostsClient\Dto\CreatePostRequest(); // \Ensi\BackendServicePostsClient\Dto\CreatePostRequest |
try {
$result = $apiInstance->createPost($create_post_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling PostsApi->createPost: ', $e->getMessage(), PHP_EOL;
}
?>
API 端点文档
所有 URI 都相对于 https:///api/v1
类 | 方法 | HTTP 请求 | 描述 |
---|---|---|---|
PostsApi | createPost | POST /posts | 创建 Post 类型的对象 |
PostsApi | deletePost | DELETE /posts/{id} | 删除 Post 类型的对象 |
PostsApi | getPost | GET /posts/{id} | 获取 Post 类型的对象 |
PostsApi | patchPost | PATCH /posts/{id} | 更新 Post 类型对象的某些字段 |
PostsApi | searchPost | POST /posts:search-one | 搜索 Post 类型的对象 |
PostsApi | searchPosts | POST /posts:search | 搜索 Post 类型的对象 |
UserVotesApi | createUserVote | POST /user-votes | 创建 UserVote 类型的对象 |
UserVotesApi | deleteUserVote | DELETE /user-votes/{id} | 删除 UserVote 类型的对象 |
UserVotesApi | patchUserVote | PATCH /user-votes/{id} | 更新 UserVote 类型对象的某些字段 |
UserVotesApi | searchUserVotes | POST /user-votes:search | 搜索 UserVote 类型的对象 |
模型文档
- CreatePostRequest
- CreateUserVoteRequest
- EmptyDataResponse
- Error
- ErrorResponse
- ErrorResponse2
- PaginationTypeCursorEnum
- PaginationTypeEnum
- PaginationTypeOffsetEnum
- PatchPostRequest
- PatchUserVoteRequest
- Post
- PostFillableProperties
- PostIncludes
- PostReadonlyProperties
- PostResponse
- RequestBodyCursorPagination
- RequestBodyOffsetPagination
- RequestBodyPagination
- ResponseBodyCursorPagination
- ResponseBodyOffsetPagination
- ResponseBodyPagination
- SearchPostsRequest
- SearchPostsResponse
- SearchPostsResponseMeta
- SearchUserVotesRequest
- SearchUserVotesResponse
- UserVote
- UserVoteFillableCreateProperties
- UserVoteFillableProperties
- UserVoteIncludes
- UserVoteReadonlyProperties
- UserVoteResponse
授权文档
所有端点均不需要授权。
作者
mail@greensight.ru