商品rpc数据格式及调用方法
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
646 B

  1. syntax = "proto3";
  2. package productrpc;
  3. // 使用key查询
  4. message GetRequest {
  5. string dbname = 1;
  6. string id = 2;
  7. string field = 3;
  8. }
  9. message GetUuidRequest {
  10. string dbname = 1;
  11. string uuid = 2;
  12. string field = 3;
  13. }
  14. // 使用key查询响应结构
  15. message GetResponse {
  16. bytes value = 1;
  17. }
  18. // rpc方法
  19. service ProductService {
  20. rpc Get (GetRequest) returns (GetResponse); // 使用id查询
  21. rpc GetByUuid (GetUuidRequest) returns (GetResponse); // 使用uuid查询
  22. rpc GetSku (GetRequest) returns (GetResponse); // 使用id查询
  23. rpc GetSkuByUuid (GetUuidRequest) returns (GetResponse); // 使用uuid查询
  24. }