api.proto 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // 定义项目 API 的 proto 文件 可以同时描述 gRPC 和 HTTP API
  2. // protobuf 文件参考:
  3. // - https://developers.google.com/protocol-buffers/
  4. // - http://info.bilibili.co/display/documentation/gRPC+Proto
  5. // protobuf 生成 HTTP 工具:
  6. // - http://git.bilibili.co/platform/go-common/tree/master/app/tool/protoc-gen-bm
  7. syntax = "proto3";
  8. // package 命名使用 {discovery_id}.{version} 的方式, version 形如 v1, v2, v1beta ..
  9. // NOTE: 不知道的 discovery_id 请询问大佬, 新项目找大佬申请 discovery_id,先到先得抢注
  10. // e.g. account.service.v1
  11. package live.zeus.v1;
  12. import "github.com/gogo/protobuf/gogoproto/gogo.proto";
  13. // NOTE: 最后请删除这些无用的注释 (゜-゜)つロ
  14. option go_package = "v1";
  15. service Zeus {
  16. // `method:"POST"`
  17. rpc Match(MatchRequest) returns (MatchResponse);
  18. }
  19. message MatchRequest {
  20. string group = 1 [(gogoproto.jsontag) = "group"];
  21. string platform = 2 [(gogoproto.jsontag) = "platform"];
  22. string version = 3 [(gogoproto.jsontag) = "version"];
  23. uint64 build = 4 [(gogoproto.jsontag) = "build"];
  24. string buvid = 5 [(gogoproto.jsontag) = "buvid"];
  25. uint64 uid = 6 [(gogoproto.jsontag) = "uid"];
  26. }
  27. message MatchResponse {
  28. bool is_match = 1 [(gogoproto.jsontag) = "is_match"];
  29. string extend = 2 [(gogoproto.jsontag) = "extend"];
  30. }