posts / posts-client
Сервис пользовательских постов
dev-master
2024-07-11 17:33 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: 2025-07-25 17:28:54 UTC
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