Skip to content

Commit d8f377e

Browse files
committed
feat: re-export openapi models
1 parent be55427 commit d8f377e

File tree

6 files changed

+798
-681
lines changed

6 files changed

+798
-681
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ once_cell = "1.19"
2020
reqwest = { version = "0.12", default-features = false, features = ["json", "gzip", "brotli", "stream"] }
2121
serde = { version = "1.0", features = ["derive"] }
2222
serde_json = "1.0"
23+
serde_with = { version = "3.8", default-features = false, features = ["base64", "macros", "std"] }
2324
thiserror = "1.0"
2425
tracing = "0.1"
2526
url = "2.5"

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ async fn main() -> Result<(), _::Error> {
4141

4242
如果你需要查看字段细节或内部逻辑,仓库中的 `./internal` 目录同步保留了由 `openapi-generator` 生成的完整结构体,随时可供参考。
4343

44+
## 模型
45+
46+
`uapi_sdk_rust::models` 直接 re-export 了 `internal/src/models` 下的所有结构体,因此你可以在 IDE 中获取与 OpenAPI 保持一致的强类型定义。例如:
47+
48+
```rust
49+
use uapi_sdk_rust::{Client, models::GetNetworkIpinfo200Response};
50+
```
51+
52+
这些模型全部派生了 `Serialize` / `Deserialize`,便于在应用中进行序列化或持久化。
53+
4454
## 错误模型概览
4555

4656
| HTTP 状态码 | SDK 错误类型 | 附加信息 |

src/models/game.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/models/mod.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1-
pub mod game;
2-
pub mod social;
1+
#![allow(clippy::all)]
2+
#![allow(dead_code)]
3+
#![allow(non_camel_case_types)]
4+
#![allow(non_snake_case)]
5+
#![allow(non_upper_case_globals)]
6+
7+
#[path = "../../internal/src/models/mod.rs"]
8+
mod generated;
9+
10+
pub use generated::*;

src/models/social.rs

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)