Skip to content

Commit 44c44b8

Browse files
author
AxT-Team Bot
committed
chore: regenerate sanitized Facades
0 parents  commit 44c44b8

File tree

847 files changed

+197550
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

847 files changed

+197550
-0
lines changed

.editorconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
root = true
2+
[*]
3+
charset = utf-8
4+
end_of_line = lf
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true

.github/workflows/release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: release
2+
on:
3+
push:
4+
tags: ['v*.*.*']
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- run: echo "Release placeholder - customize per registry"

.github/workflows/test.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name: test
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- uses: php-actions/composer@v6
9+
- run: composer install

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.DS_Store
2+
.idea/
3+
.vscode/
4+
dist/
5+
build/
6+
coverage/

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# uapi-sdk-php
2+
3+
![Banner](./banner.png)
4+
5+
[![PHP](https://img.shields.io/badge/PHP-8.1+-777BB4?style=flat-square&logo=php&logoColor=white)](https://www.php.net/)
6+
[![Docs](https://img.shields.io/badge/Docs-uapis.cn-2EAE5D?style=flat-square)](https://uapis.cn/)
7+
8+
> [!NOTE]
9+
> 所有接口的 PHP 示例都可以在 [UApi](https://uapis.cn/docs/introduction) 的接口文档页面,向下滚动至 **快速启动** 区块后直接复制。
10+
11+
## 快速开始
12+
13+
```bash
14+
composer require uapis/uapi-sdk-php
15+
```
16+
17+
```php
18+
<?php
19+
require 'vendor/autoload.php';
20+
21+
$client = new Uapi\Client('https://uapis.cn/api/v1');
22+
$result = $client->social()->getSocialQqUserinfo(['qq' => '10001']);
23+
var_dump($result);
24+
```
25+
26+
## 特性
27+
28+
现在你不再需要反反复复的查阅文档了。
29+
30+
只需在 IDE 中键入 `$client->`,所有核心模块——如 `social()``game()``image()`——即刻同步展现。进一步输入即可直接定位到 `getSocialQqUserinfo` 这样的具体方法,其名称与文档的 `operationId` 严格保持一致,确保了开发过程的直观与高效。
31+
32+
所有方法签名只接受真实且必需的参数。当你在构建请求时,IDE 会即时提示 `qq``username` 等键名,这彻底杜绝了在关联数组中因键名拼写错误而导致的运行时错误。
33+
34+
针对 401、404、429 等标准 HTTP 响应,SDK 已将其统一映射为具名的异常类型。这些异常均附带 `code``status``details` 等关键上下文信息,确保你在日志中能第一时间准确、快速地诊断问题。
35+
36+
HTTP 层基于 Guzzle,构造函数会自动设置 Base URL、追加 `Authorization` 头并关闭 `http_errors`,方便你直接读取 JSON/字节响应;需要更细致的超时或代理策略时,可以按需扩展这段初始化逻辑。
37+
38+
如果你需要查看字段细节或内部逻辑,仓库中的 `./internal` 目录同步保留了由 `openapi-generator` 生成的完整结构体,随时可供参考。
39+
40+
## 错误模型概览
41+
42+
| HTTP 状态码 | SDK 错误类型 | 附加信息 |
43+
|-------------|----------------------------------------------|------------------------------------------------------------------------------------|
44+
| 401/403 | `UnauthorizedError` | `code``status` |
45+
| 404 | `NotFoundError` / `NoMatchError` | `code``status` |
46+
| 400 | `InvalidParameterError` / `InvalidParamsError` | `code``status``details` |
47+
| 429 | `ServiceBusyError` | `code``status``retry_after_seconds` |
48+
| 5xx | `InternalServerErrorError` / `ApiErrorError` | `code``status``details` |
49+
| 其他 4xx | `UapiError` | `code``status``details` |
50+
51+
## 其他 SDK
52+
53+
| 语言 | 仓库地址 |
54+
|-------------|--------------------------------------------------------------|
55+
| Go | https://github.com/AxT-Team/uapi-go-sdk |
56+
| Python | https://github.com/AxT-Team/uapi-python-sdk |
57+
| TypeScript| https://github.com/AxT-Team/uapi-typescript-sdk |
58+
| Browser (TypeScript/JavaScript)| https://github.com/AxT-Team/uapi-browser-sdk |
59+
| Java | https://github.com/AxT-Team/uapi-java-sdk |
60+
| PHP(当前) | https://github.com/AxT-Team/uapi-php-sdk |
61+
| C# | https://github.com/AxT-Team/uapi-csharp-sdk |
62+
| C++ | https://github.com/AxT-Team/uapi-cpp-sdk |
63+
| Rust | https://github.com/AxT-Team/uapi-rust-sdk |
64+
65+
## 文档
66+
67+
访问 [UApi文档首页](https://uapis.cn/docs/introduction) 并选择任意接口,向下滚动到 **快速启动** 区块即可看到最新的 PHP 示例代码。

banner.png

1.84 MB
Loading

composer.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "uapis/uapi-sdk-php",
3+
"type": "library",
4+
"require": { "php": ">=8.1", "guzzlehttp/guzzle": "^7.8" },
5+
"autoload": { "psr-4": { "Uapi\\": "src/" } }
6+
}

internal/.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore
2+
3+
composer.phar
4+
/vendor/
5+
6+
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
7+
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
8+
# composer.lock
9+
10+
# php-cs-fixer cache
11+
.php_cs.cache
12+
.php-cs-fixer.cache
13+
14+
# PHPUnit cache
15+
.phpunit.result.cache

internal/.openapi-generator-ignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# OpenAPI Generator Ignore
2+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
3+
4+
# Use this file to prevent files from being overwritten by the generator.
5+
# The patterns follow closely to .gitignore or .dockerignore.
6+
7+
# As an example, the C# client generator defines ApiClient.cs.
8+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9+
#ApiClient.cs
10+
11+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
12+
#foo/*/qux
13+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14+
15+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16+
#foo/**/qux
17+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18+
19+
# You can also negate patterns with an exclamation (!).
20+
# For example, you can ignore all files in a docs folder with the file extension .md:
21+
#docs/*.md
22+
# Then explicitly reverse the ignore rule for a single file:
23+
#!docs/README.md

0 commit comments

Comments
 (0)