borzistyi/backend-service-posts-client

dev-master 2024-07-10 10:35 UTC

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 请求描述
PostsApicreatePostPOST /posts创建 Post 类型的对象
PostsApideletePostDELETE /posts/{id}删除 Post 类型的对象
PostsApigetPostGET /posts/{id}获取 Post 类型的对象
PostsApipatchPostPATCH /posts/{id}更新 Post 类型对象的某些字段
PostsApisearchPostPOST /posts:search-one搜索 Post 类型的对象
PostsApisearchPostsPOST /posts:search搜索 Post 类型的对象
UserVotesApicreateUserVotePOST /user-votes创建 UserVote 类型的对象
UserVotesApideleteUserVoteDELETE /user-votes/{id}删除 UserVote 类型的对象
UserVotesApipatchUserVotePATCH /user-votes/{id}更新 UserVote 类型对象的某些字段
UserVotesApisearchUserVotesPOST /user-votes:search搜索 UserVote 类型的对象

模型文档

授权文档

所有端点均不需要授权。

作者

mail@greensight.ru