tianyuan-api-server/apps/api/api.proto
2024-10-02 00:57:17 +08:00

52 lines
1.4 KiB
Protocol Buffer

syntax = "proto3";
package product;
option go_package = "./api";
service ProductService {
// 获取产品列表
rpc GetProducts(ProductListReq) returns (ProductListResp);
// 获取用户开通的产品列表
rpc GetUserProducts(UserProductListReq) returns (UserProductListResp);
}
// 获取产品列表的请求
message ProductListReq {}
// 获取产品列表的响应
message ProductListResp {
repeated ProductItem products = 1;
}
// 产品信息
message ProductItem {
int64 id = 1; // 产品ID
string product_name = 2; // 产品名称
string product_code = 3; // 产品编号
string product_description = 4; // 产品简介
string product_content = 5; // 产品内容
float product_price = 6; // 产品价格
string created_at = 7; // 产品创建时间
}
// 获取用户开通的产品列表的请求
message UserProductListReq {
int64 user_id = 1; // 用户ID
}
// 获取用户开通的产品列表的响应
message UserProductListResp {
repeated UserProductItem user_products = 1;
}
// 用户产品信息
message UserProductItem {
int64 id = 1; // 用户产品ID
int64 user_id = 2; // 用户ID
int64 product_id = 3; // 产品ID
string activation_date = 4; // 激活时间
string expiration_date = 5; // 到期时间
}