posts/posts-client

Сервис пользовательских постов

dev-master 2024-07-11 17:33 UTC

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

ClassMethodHTTP requestDescription
PostsApicreatePostPOST /postsСоздание поста
PostsApideletePostDELETE /posts/{id}Удаление поста
PostsApigetPostGET /posts/{id}Получение поста по id
PostsApipatchPostPATCH /posts/{id}Обновление поста
PostsApisearchPostPOST /posts:search-oneПоиск одного поста
PostsApisearchPostsPOST /posts:searchПоиск постов
UsersVotesApicreateUserVotePOST /users-votesСоздание голоса пользователя
UsersVotesApideleteUserVoteDELETE /users-votes/{id}Удаление голоса пользователя
UsersVotesApigetUserVoteGET /users-votes/{id}Получение голоса пользователя по id
UsersVotesApipatchUserVotePATCH /users-votes/{id}Обновление голоса пользователя
UsersVotesApisearchUsersVotesPOST /users-votes:searchПоиск голоса пользователя

Documentation For Models

Documentation For Authorization

All endpoints do not require authorization.

Author

ignatev@greensight.ru