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

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