170 lines
4.5 KiB
Protocol Buffer
170 lines
4.5 KiB
Protocol Buffer
syntax = "proto3";
|
||
package mall;
|
||
option go_package = "./mall";
|
||
|
||
// EC-Mall模块
|
||
service Store {
|
||
// 店铺列表
|
||
rpc List(Empty) returns(StoreListReply) {};
|
||
|
||
// 获取所有分类数据
|
||
rpc Category(UniqueIndex) returns(CategoryReply) {};
|
||
|
||
// 推荐商品
|
||
rpc Recommend(RecommendRequest) returns(RecommendReply) {};
|
||
|
||
// 商品列表
|
||
rpc ProductList(ListRequest) returns(ListReply) {};
|
||
|
||
// 商品搜索
|
||
rpc Search(SearchRequest) returns(ListReply) {};
|
||
|
||
// 商品详情
|
||
rpc ProductGet(GetRequest) returns (GetReply) {};
|
||
|
||
// 评论列表
|
||
rpc CommentList(CommentListRequest) returns (CommentListReply) {};
|
||
}
|
||
message Empty{
|
||
}
|
||
|
||
message StoreListReply{
|
||
repeated StoreBasic data = 1;
|
||
}
|
||
|
||
message StoreBasic{
|
||
int64 id =1;
|
||
string key=2; //店铺唯一KEY
|
||
string title=3; // 标题
|
||
string intro=4; // 描述说明
|
||
string template=5; // 模板
|
||
string configs=6; // 配置说明
|
||
string created_at = 7; //创建时间
|
||
}
|
||
|
||
// 店铺唯一KEY
|
||
message UniqueIndex {
|
||
string store_key = 1; //店铺唯一KEY
|
||
}
|
||
|
||
// 产品分类数据列表
|
||
message CategoryReply{
|
||
repeated CategoryItem data = 1;
|
||
}
|
||
|
||
|
||
message CategoryItem{
|
||
int64 id = 1; //ID
|
||
string title = 2; //名称
|
||
string en_title = 3; //英文名称
|
||
string keys =4; //关键词
|
||
int64 parent_id = 5; //上级ID
|
||
string paths = 6; //路径
|
||
string intro = 7; //简介
|
||
string icon = 8; //图标
|
||
int64 sort = 9; //排序
|
||
}
|
||
|
||
message RecommendRequest {
|
||
string store_key = 1; //店铺唯一KEY
|
||
int32 code = 2; //推荐状态码
|
||
int32 number = 3; //数量
|
||
}
|
||
|
||
message RecommendReply {
|
||
//推荐商品列表
|
||
repeated ProductItem data = 1;
|
||
}
|
||
|
||
message ListRequest {
|
||
string store_key = 1; //店铺唯一KEY
|
||
int64 category_id = 2; //分类ID
|
||
int32 page = 3; // 当前页数,默认第一页,取值1~50 页
|
||
int32 size = 4; // 每页显示条数,默认10条,取值1~50 条/每次
|
||
}
|
||
|
||
message SearchRequest {
|
||
string store_key = 1; //店铺唯一KEY
|
||
int64 category_id = 2; //分类ID
|
||
string keyword = 3; //关键字
|
||
int32 page = 4; // 当前页数,默认第一页,取值1~50 页
|
||
int32 size = 5; // 每页显示条数,默认10条,取值1~50 条/每次
|
||
}
|
||
|
||
message ListReply {
|
||
int64 count = 1; // 课程数量
|
||
repeated ProductItem data = 2;//商品数据列表
|
||
}
|
||
|
||
message ProductItem{
|
||
int64 id = 1; //商品ID
|
||
string identity = 2; //商品唯一码
|
||
int64 supply_id =4; //供应商ID
|
||
int32 types = 5; //商品类型:Product=1 实体商品,Service=2 服务,Membership=3 会员服务,Other=4 其它
|
||
int64 category_id = 6; //分类ID
|
||
string category_paths = 7; //分类路径
|
||
string title = 8; //商品标题
|
||
string sub_title = 9; //商品标题
|
||
string keyword = 10; //商品关键字
|
||
string cover_image = 11; //商品封面图片
|
||
int32 stock = 12; //库存
|
||
int64 sales_price = 13; //销售价
|
||
string content = 14; //商品详情
|
||
string args = 15; //商品相关参数JSON
|
||
int64 star = 16; //商品星级
|
||
int32 comment_total = 17; //评论总数
|
||
int32 sale_total = 18; //销售总数
|
||
int32 view_total = 19; //查看总数
|
||
int32 image_total = 20; //图片总数
|
||
int32 recommend = 21; //推荐码:0不推荐,1推荐的状态
|
||
int32 sort = 22; //排序
|
||
int32 status = 23; //状态(0未上架,1上架)
|
||
}
|
||
|
||
message GetRequest {
|
||
string identity = 1; //商品唯一码
|
||
string store_key = 2; //店铺唯一KEY
|
||
}
|
||
|
||
message GetReply {
|
||
ProductItem detail = 1; //商品详情数据
|
||
repeated AttrItem attr = 2; //商品属性数据
|
||
repeated PhotosItem photos = 3; //商品相册数据
|
||
}
|
||
|
||
message AttrItem{
|
||
int64 id = 1; //属性ID
|
||
string name = 2; //属性名称
|
||
int32 parent_id =3; //上级ID
|
||
string value = 4; //属性值
|
||
}
|
||
|
||
message PhotosItem{
|
||
int64 id = 1; //相册ID
|
||
string name = 2; //相册名称
|
||
string url =3; //URL
|
||
int32 sort = 4; //排序
|
||
}
|
||
|
||
|
||
message CommentItem{
|
||
int64 id = 1; //ID
|
||
string created = 2; //创建时间
|
||
int64 passport_id = 4; //评论人ID
|
||
string passport_identity = 5; //用户名称
|
||
string nickname = 6; //用户名称
|
||
int32 score = 7; //评分
|
||
string comment = 8; //评论正文
|
||
string reply = 9; //回复正文
|
||
}
|
||
|
||
message CommentListRequest {
|
||
string product_identity = 1; //商品Identity
|
||
int32 page = 2; // 当前页数,默认第一页,取值1~50 页
|
||
int32 size = 3; // 每页显示条数,默认10条,取值1~50 条/每次
|
||
}
|
||
|
||
message CommentListReply {
|
||
int64 count = 1; // 课程数量
|
||
repeated CommentItem data = 2;//评论列表
|
||
} |