商品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.

30 lines
686 B

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