Files
proto/README.md
2025-08-18 16:42:32 +08:00

68 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 神仙盒公共 gRPC 服务定义
## 项目简介
这是神仙盒Shenxianhe项目的公共 gRPC 服务 Protocol Buffers 定义文件。本仓库包含了项目中所有微服务的接口定义,用于服务间通信和客户端 SDK 生成。
## 目录结构
```
proto/
├── README.md
├── buf.yaml
└── shenxianhe/
└── v1/
└── account.proto # 账户服务接口定义
```
## 使用指南
### 安装依赖
本项目使用 [Buf](https://buf.build/) 进行 Protocol Buffers 的管理和构建。请先安装 Buf
```bash
go install github.com/bufbuild/buf/cmd/buf@latest
```
### 检查语法
```bash
# 在 proto 目录下运行
buf lint
```
### 检查兼容性
```bash
# 检查 API 兼容性
buf breaking --against .git#branch=main
```
## 版本控制
本项目使用语义化版本控制,服务接口的变更遵循以下原则:
1. **向后兼容**:尽量保持接口的向后兼容性
2. **版本升级**:不兼容的变更会导致版本号的升级
3. **Breaking Change 检查**:使用 buf breaking 工具检查不兼容的变更
## 开发规范
1. 遵循 [Protocol Buffers Style Guide](https://developers.google.com/protocol-buffers/docs/style)
2. 使用标准的 lint 规则STANDARD
3. 每个服务定义放在单独的目录下,并按版本号组织
4. 新增字段时使用新的字段编号,不要重用已删除字段的编号
## 贡献指南
1. Fork 本仓库
2. 创建特性分支
3. 提交变更
4. 运行 `buf lint``buf breaking` 检查
5. 创建 Pull Request
## 版权信息
© 2025 神仙盒团队. All rights reserved.