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

51 lines
1.5 KiB

  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 uuid = 3;
  14. string field = 4;
  15. }
  16. // 使用key查询响应结构
  17. message GetResponse {
  18. bytes value = 1;
  19. }
  20. // 配置信息请求结构
  21. message Request {
  22. string data = 1;
  23. string time = 2;
  24. string sign = 3;
  25. }
  26. // 配置信息响应结构
  27. message Response {
  28. string data = 1;
  29. string time = 2;
  30. string sign = 3;
  31. }
  32. // rpc方法
  33. service ProductService {
  34. rpc Get (GetRequest) returns (GetResponse); // 使用id查询
  35. rpc GetByUuid (GetUuidRequest) returns (GetResponse); // 使用uuid查询
  36. rpc GetSku (GetRequest) returns (GetResponse); // 使用id查询
  37. rpc GetSkuByUuid (GetUuidRequest) returns (GetResponse); // 使用uuid查询
  38. rpc GetActivity(Request) returns (Response); //查询商品所在的活动
  39. rpc GetAllActivity(Request) returns (Response); //查询商品所在的所有活动
  40. rpc GetWarmingActivity(Request) returns (Response); //查询商品所在的预热中活动
  41. rpc FavoriteProduct(Request) returns(Response);//收藏商品
  42. rpc GetProductActivity(Request) returns (Response); //查询商品所在的活动
  43. rpc GetProductAllActivity(Request) returns (Response); //查询商品所在的所有活动
  44. rpc GetProductWarmingActivity(Request) returns (Response); //查询商品所在的预热中活动
  45. }