自动生成 protobuf 代码 (tag: v1.0.0)

This commit is contained in:
sky
2025-08-20 22:10:16 +08:00
parent 0174a4f4ff
commit f87f445192

73
README.md Normal file
View File

@@ -0,0 +1,73 @@
# Go SDK 自动生成文档
## 项目简介
这是由 protobuf 自动生成的 Go SDK用于与 shenxianhe 服务进行交互。
## SDK 版本与 API 版本的区别
**SDK 版本**
- 由 Git tag 管理,格式为 vX.Y.Z
- 表示生成的 SDK 代码的版本号
- 每次重新生成并发布代码时会自增
**API 版本**
- 体现在 proto 文件路径中,如 v1、v2 等
- 表示服务接口的版本号
- 由服务端定义和维护
两个版本号是相互独立的概念,同一 API 版本可能对应多个 SDK 版本。
## 使用示例
### 导入依赖
```go
import (
"context"
"git.0yue.com/shenxianhe/sdk/account/v1"
"git.0yue.com/shenxianhe/sdk/notification/v1"
"connectrpc.com/connect"
)
```
### 创建客户端并调用接口
```go
// 创建AccountService客户端
client := account.NewAccountServiceClient(
connect.NewHttpClient(nil),
"http://your-service-url",
)
// 调用Auth接口
resp, err := client.Auth(
context.Background(),
connect.NewRequest(&account.AuthRequest{
AuthType: account.AuthenticationType_AUTHENTICATION_TYPE_PHONE,
AuthId: "13800138000",
Credential: "123456",
}),
)
if err != nil {
// 处理错误
}
// 使用响应结果
result := resp.Msg
```
## 版本历史
- 详见 Git 仓库中的 tag 信息
## 注意事项
- 本 SDK 由代码自动生成,请勿手动修改
- 如有任何问题,请联系服务提供方
## 版权信息
© 2025 神仙盒团队. All rights reserved.