posts/posts-client
Composer 安装命令:
composer require posts/posts-client
包简介
Сервис пользовательских постов
README 文档
README
Сервис пользовательских постов
This PHP package is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- Build package: org.openapitools.codegen.languages.PhpClientCodegen For more information, please visit https://ensi.tech/contacts
Requirements
PHP 5.5 and later
Installation & Usage
Composer
To install the bindings via Composer, add the following to composer.json:
{
"repositories": [
{
"type": "vcs",
"url": "https://gitlab.com/greensight/ensi/backend-service-skeleton-client-php.git"
}
],
"require": {
"posts/posts-client": "*@dev"
}
}
Then run composer install
Manual Installation
Download the files and include autoload.php:
require_once('/path/to/PostsClient/vendor/autoload.php');
Tests
To run the unit tests:
composer install
./vendor/bin/phpunit
Getting Started
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Posts\PostsClient\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 \Posts\PostsClient\Dto\CreatePostRequest(); // \Posts\PostsClient\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;
}
?>
Documentation for API Endpoints
All URIs are relative to http://localhost/api/v1
| Class | Method | HTTP request | Description |
|---|---|---|---|
| PostsApi | createPost | POST /posts | Создание поста |
| PostsApi | deletePost | DELETE /posts/{id} | Удаление поста |
| PostsApi | getPost | GET /posts/{id} | Получение поста по id |
| PostsApi | patchPost | PATCH /posts/{id} | Обновление поста |
| PostsApi | searchPost | POST /posts:search-one | Поиск одного поста |
| PostsApi | searchPosts | POST /posts:search | Поиск постов |
| UsersVotesApi | createUserVote | POST /users-votes | Создание голоса пользователя |
| UsersVotesApi | deleteUserVote | DELETE /users-votes/{id} | Удаление голоса пользователя |
| UsersVotesApi | getUserVote | GET /users-votes/{id} | Получение голоса пользователя по id |
| UsersVotesApi | patchUserVote | PATCH /users-votes/{id} | Обновление голоса пользователя |
| UsersVotesApi | searchUsersVotes | POST /users-votes:search | Поиск голоса пользователя |
Documentation For Models
- CreatePostRequest
- CreateUserVoteRequest
- DifficultyTypeEnum
- EmptyDataResponse
- Error
- ErrorResponse
- ErrorResponse2
- PaginationTypeCursorEnum
- PaginationTypeEnum
- PaginationTypeOffsetEnum
- PatchPostRequest
- PatchUserVoteRequest
- Post
- PostFillableProperties
- PostIncludes
- PostReadonlyProperties
- PostResponse
- RequestBodyCursorPagination
- RequestBodyOffsetPagination
- RequestBodyPagination
- ResponseBodyCursorPagination
- ResponseBodyOffsetPagination
- ResponseBodyPagination
- SearchOnePostRequest
- SearchPostsRequest
- SearchPostsResponse
- SearchPostsResponseMeta
- SearchUsersVotesRequest
- SearchUsersVotesResponse
- UserVote
- UserVoteFillableProperties
- UserVoteReadonlyProperties
- UserVoteResponse
Documentation For Authorization
All endpoints do not require authorization.
Author
ignatev@greensight.ru
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-11