Files
full/module/ec/mall/proto/product.proto

302 lines
12 KiB
Protocol Buffer
Raw Normal View History

syntax = "proto3";
package mall;
option go_package = ".;mall";
import "blocks.proto";
// 产品相关
service Product{
// 获取产品列表
rpc ItemFetch(FetchRequest) returns(ListReply) {};
// 获取产品详情
rpc ItemDetail(IdentRequest) returns(ProductItem) {};
// 通过产品序列获取产品详情
rpc ItemDetailBySerial(StoreSerialRequest) returns(ListReply) {};
// 通过规格编号获取产品详情
rpc ItemDetailBySpec(DetailBySpecRequest) returns(ListItem) {};
// 添加产品
rpc ItemCreate(ProductItem) returns(StatusReply) {};
// 删除产品
rpc ItemDelete(IdentRequest) returns(StatusReply) {};
// 发布/取消发布 产品
rpc ItemModify(ModifyRequest) returns(StatusReply) {};
// 批量操作
rpc ItemBatchOp(OpRequest) returns(StatusReply) {};
// 产品规格列表
rpc SpecFetch(FetchRequest) returns(SpecReply) {};
// 添加产品规格
rpc SpecCreate(SpecItem) returns(StatusReply) {};
// 修改产品规格
rpc SpecModify(SpecItem) returns(StatusReply) {};
// 删除产品规格
rpc SpecDelete(IdentRequest) returns(StatusReply) {};
// 产品详情
rpc SpecDetail(IdentRequest) returns(SpecItem) {};
// 添加产品图片
rpc PhotoCreate(PhotoItem) returns(StatusReply){};
// 删除产品图片
rpc PhotoDelete(IdentRequest) returns(StatusReply){};
// 产品图片列表
rpc PhotoList(PhotoItem) returns(PhotoReply){};
// 产品的评论列表
rpc CommentFetch(FetchRequest) returns (CommentListReply) {};
// 评论
rpc CommentCreate(CommentItem) returns(StatusReply) {};
// 回复评论
rpc CommentRe(CommentItem) returns(StatusReply) {};
// 删除评论
rpc CommentDelete(IdentRequest) returns(StatusReply) {};
// 修改评论
rpc CommentModify(CommentItem) returns(StatusReply) {};
}
// 商品属性
message AttrItem{
int64 id = 1; //属性ID
string name = 2; //属性名称
int32 parent_id =3 [json_name="parent_id"]; //上级ID
string value = 4; //属性值
}
// 商品评论
message CommentItem{
int64 id = 1; //ID
string identity = 2; // 评论唯一标识
string created_at = 3 [json_name="created_at"]; //创建时间
string nick_name = 4 [json_name="nick_name"]; //用户名称
int32 score = 5; //评分
string comment = 6; //评论正文
string reply = 7; //回复正文
string product_identity =8 [json_name="product_identity"]; // 所属商品唯一标识
string store_identity = 9 [json_name="store_identity"];// 店铺唯一标识
string spec_identity = 10 [json_name="spec_identity"];// 产品规格唯一标识
string comment_identity = 11 [json_name="comment_identity"]; // 被回复的评论唯一标识
string product = 12;// 所属商品
string product_spec = 13 [json_name="product_spec"];// 产品规格
bool is_comment = 14 [json_name="is_comment"]; // 是否是评论
}
message CommentItemRep{
int64 id = 1; //ID
string identity = 2; // 评论唯一标识
string created_at = 3 [json_name="created_at"]; //创建时间
string nick_name = 4 [json_name="nick_name"]; //用户名称
int32 score = 5; //评分
string comment = 6; //评论正文
string reply = 7; //回复正文
string product_identity =8 [json_name="product_identity"]; // 所属商品唯一标识
string store_identity = 9 [json_name="store_identity"];// 店铺唯一标识
string spec_identity = 10 [json_name="spec_identity"];// 产品规格唯一标识
string comment_identity = 11 [json_name="comment_identity"]; // 被回复的评论唯一标识
repeated CommentItem list = 12; // 评论列表
string product = 13;// 所属商品
string product_spec = 14 [json_name="product_spec"];// 产品规格
}
message DetailBySpecRequest{
string spec_no = 1 [json_name="spec_no"]; // 产品规格编号
}
message OpRequest{
repeated string identity = 1; // 需要被禁用的产品唯一标识
int32 status =2; // 更新的数据
}
message ModifyRequest{
string identity = 1; // 产品唯一标识
int32 status = 2; // 商品状态1-已上架2-自动上架等待中禁止web手动传入3-禁用 4-草稿5-未上架
}
message ListItem{
int64 product_id = 2 [json_name="product_id"]; // 产品id
string product = 3; // 产品名称
int64 spec_id = 4 [json_name="spec_id"]; // 规格id
string spec = 5; // 规格名称
string spec_no = 6 [json_name="spec_no"]; // 规格编号
int64 price = 7; // 单价,单位分
int64 count = 8; // 数量
string img = 9; // 产品图片
string product_identity = 10 [json_name="product_identity"]; // 产品唯一标识
string serial_id = 11 [json_name="serial_id"]; // 产品序号
}
message ListWithIdRequest{
repeated int64 id = 1; // specId列表
}
message ListWithIdReply{
repeated ListItem data =1;
}
//---- Reply 部分
message PhotoReply{
int64 count = 1;
repeated PhotoItem data = 2;//
}
message SpecReply{
int64 count =1;
repeated SpecItem data = 2;
}
message CommentListReply {
int64 count = 1; // 数量
repeated CommentItemRep data = 2;//评论列表
}
message StatisticReply{
int64 total = 1; // 当前产品总数
int64 selling = 2; // 在售数量
int64 forbidden = 3; // 禁用数量
int64 draft = 4; // 草稿数量
}
message OrgBySpecIdReply{
int64 id = 1; // 机构id
string identity = 2; // 店铺唯一标识
string title = 3; // 机构名称
}
// 备用的产品附加信息
message Subjoin{
string category_paths = 1 [json_name="category_paths"]; //分类路径
string sub_title = 2 [json_name="sub_title"]; //商品标题
string keyword = 3; //商品关键字
int32 stock = 4; //库存
int64 sales_price = 5 [json_name="sales_price"]; //销售价
string args = 6; //商品相关参数JSON
int32 comment_total = 7 [json_name="comment_total"]; //评论总数
int32 sale_total = 8 [json_name="sale_total"]; //销售总数
int32 view_total = 9 [json_name="view_total"]; //查看总数
int32 image_total = 10 [json_name="image_total"]; //图片总数
int32 recommend = 11; //推荐码0不推荐1推荐的状态
int32 sort = 12; //排序
int32 types = 13; //商品类型:Product=1 实体商品,Service=2 服务,Membership=3 会员服务,Other=4 其它
int64 star = 14; //商品星级
}
message ListReply{
int64 count = 1; // 数量
repeated ProductItem data = 2; // 产品列表
}
message ProductBase{
int64 id = 1; //商品ID
string identity = 2; //商品唯一码
int64 supply_id = 4 [json_name="supply_id"]; //供应商ID
int64 category_id = 6 [json_name="category_id"]; //分类ID
string title = 8; //商品标题
string measuring_name = 99 [json_name="measuring_name"]; // 测量单位名称
int64 sell_max = 97 [json_name="sell_max"]; // 最大限购数量
int64 sell_min = 96 [json_name="sell_min"]; // 最小限购数量
int64 wastage = 95; // 损耗率
string standard_number = 94 [json_name="standard_number"]; // 产品标准号
string brand = 93; // 品牌名称
int64 stock_type = 92 [json_name="stock_type"]; // 库存计数方式1-买方下单减库存2-完成签约减库存
int32 status = 91; // 商品状态0-未上架1-已上架2-自动上架等待中3-禁用 4-草稿
string putaway_time = 90 [json_name="putaway_time"]; // 预定的上架时间 YYYY-MM-DD HH:mm:ss
string cover_image = 11 [json_name="cover_image"]; //商品封面图片
repeated string images = 24; // 产品图片
string content = 14; //商品详情
string serial_id = 15 [json_name="serial_id"]; // 产品序号
}
message SpecItem{
int64 id = 1; //
string identity = 2; // 唯一标识
int64 supply_id = 3 [json_name="supply_id"]; //供应商ID
string product_identity = 4 [json_name="product_identity"]; // 产品唯一标识
string store_identity = 5 [json_name="store_identity"];// 店铺唯一标识
string title = 6; // 名称
int32 stock_type = 7 [json_name="stock_type"]; // 库存设置1-设置库存限制2-不设置库存限制
int64 stock = 8; // 库存数量
int64 price = 9 ; // 价格,单位:分
int64 direct_sales = 10 [json_name="direct_sales"]; // 直营价格,单位:分
int32 tp_type = 11 [json_name="tp_type"]; // 阶梯价设置:1-启用,2-不启用
int32 ds_tp_type = 12 [json_name="ds_tp_type"];// 直营阶梯价设置:1-启用,2-不启用
string img = 13; // 预览图
string spec_no = 14 [json_name="spec_no"];// 规格编号
string keyword = 15 ;// 关键字
int64 purchasing_price = 16 [json_name="purchasing_price"]; // 进口价格,单位:分
int64 wholesale = 17;// 代理价,单位:分
}
message PhotoItem{
string name = 1; // 图片名称
string identity = 2; // 图片唯一标识
string product_identity = 3 [json_name="product_identity"]; // 所属产品唯一标识
string url = 4; // 图片地址
int32 sort = 5; // 排序方式
string types = 6; // cover封面img普通图片
int64 id = 7; // 图片id
}
message CategoriesItem{
int64 id = 1; //ID
string identity = 2;
string title = 3; //名称
string en_title = 4 [json_name="en_title"]; //英文名称
int64 parent_id = 5 [json_name="parent_id"]; //上级ID
string paths = 6; //路径
string intro = 7; //简介
string icon = 8; //图标
int32 sort = 9; //排序
int32 status = 10; // 状态1-正常2停用
string created_at = 11 [json_name="created_at"]; // 创建时间
repeated CategoriesItem categories = 12; // 子集
string keys = 13; //关键词
}
message ProductItem{
int64 id = 1; //商品ID
string identity = 2; //商品唯一码
int64 supply_id = 3 [json_name="supply_id"]; //供应商ID
repeated int64 category_id = 4 [json_name="category_id"]; //分类ID
string title = 5; //商品标题
string measuring_name = 6 [json_name="measuring_name"]; // 测量单位名称
int64 sell_max = 7 [json_name="sell_max"]; // 最大限购数量
int64 sell_min = 8 [json_name="sell_min"]; // 最小限购数量
int64 wastage = 9; // 损耗率
string standard_number = 10 [json_name="standard_number"]; // 产品标准号
string brand = 11; // 品牌名称
int64 stock_type = 12 [json_name="stock_type"]; // 库存计数方式1-买方下单减库存2-完成签约减库存
int32 status = 13; // 商品状态1-已上架2-自动上架等待中3-禁用 4-草稿,5-未上架
string putaway_time = 14 [json_name="putaway_time"]; // 预定的上架时间 YYYY-MM-DD HH:mm:ss
string cover_image = 15 [json_name="cover_image"]; //商品封面图片
string content = 16; //商品详情
int64 store_id = 17 [json_name="store_id"]; // 店铺的ID
string store_identity = 18 [json_name="store_identity"]; // 店铺唯一标识
int32 template_id = 19 [json_name="template_id"]; // 运费模板id
string note = 20; // 备注
repeated PhotoItem images = 21; // 产品图片
repeated SpecItem specification = 22; // 产品规格信息
int64 recent_number = 23 [json_name="recent_number"]; // 近期销售数量
int64 sale_total = 24 [json_name="sale_total"]; // 销售总数量
string created_at = 25 [json_name="created_at"]; // 创建时间
int64 limitation = 26; // 区域限制1不限制2限制
int64 liTemplate_id = 27 [json_name="liTemplate_id"]; // 区域限制的模板id
int64 price = 28; // 售价(选择价格最低的规格数据)
int64 stock = 29; // 库存(选择价格最低的规格数据)
string category = 30; // 分类名称
string serial_id = 31 [json_name="serial_id"]; // 产品序号
int64 gas_types = 32 [json_name="gas_types"]; // 产品分类21查看非燃气商品2按瓶计算的产品3按kg计算的产品
repeated int64 spec_id = 33 [json_name="spec_id"]; // 规格ID
repeated CategoriesItem categories = 34;// 分类
string supply_name = 35 [json_name="supply_name"];// 供应商名称
}