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

48 lines
1.1 KiB

syntax = "proto3";
package productrpc;
// 使用key查询
message GetRequest {
string site_id = 1;
string dbname = 2;
string id = 3;
string field = 4;
}
message GetUuidRequest {
string site_id = 1;
string dbname = 2;
string uuid = 3;
string field = 4;
}
// 使用key查询响应结构
message GetResponse {
bytes value = 1;
}
// 配置信息请求结构
message Request {
string data = 1;
string time = 2;
string sign = 3;
}
// 配置信息响应结构
message Response {
string data = 1;
string time = 2;
string sign = 3;
}
// rpc方法
service ProductService {
rpc Get (GetRequest) returns (GetResponse); // 使用id查询
rpc GetByUuid (GetUuidRequest) returns (GetResponse); // 使用uuid查询
rpc GetSku (GetRequest) returns (GetResponse); // 使用id查询
rpc GetSkuByUuid (GetUuidRequest) returns (GetResponse); // 使用uuid查询
rpc GetActivity(Request) returns (Response); //查询商品所在的活动
rpc GetAllActivity(Request) returns (Response); //查询商品所在的所有活动
rpc GetWarmingActivity(Request) returns (Response); //查询商品所在的预热中活动
}