116 lines
2.5 KiB
Protocol Buffer
116 lines
2.5 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package product;
|
|
option go_package="./product";
|
|
|
|
|
|
// OKResp
|
|
message OKResp {}
|
|
// NoneReq
|
|
message NoneReq {}
|
|
|
|
// ====================== Category Param ======================
|
|
message CreateCategoryReq {
|
|
string name = 1;
|
|
}
|
|
|
|
message ModifyCategoryReq {
|
|
string id =1;
|
|
string name = 2;
|
|
}
|
|
|
|
message CategoryReq {
|
|
string id =1;
|
|
}
|
|
|
|
message Category {
|
|
string id =1;
|
|
string name =2;
|
|
int64 create_time=3;
|
|
int64 update_time=4;
|
|
}
|
|
|
|
message ListCategoryReq {
|
|
int64 page_index =1;
|
|
int64 page_size =2;
|
|
repeated string ids=3;
|
|
}
|
|
|
|
message ListCategoryResp {
|
|
int64 total =1;
|
|
repeated Category data=3;
|
|
}
|
|
|
|
// ====================== Tags Param ======================
|
|
|
|
message CreateTagsReq{
|
|
int32 types=1;
|
|
string name=2;
|
|
int64 show_type=3;
|
|
optional string cover=4;
|
|
}
|
|
|
|
message ModifyTagsReq{
|
|
string id=1;
|
|
optional int32 types=2;
|
|
optional string name=3;
|
|
optional int64 show_type=4;
|
|
optional string cover=5;
|
|
}
|
|
|
|
message TagsReq {
|
|
string id =1;
|
|
}
|
|
|
|
message Tags{
|
|
string id=1;
|
|
int32 types=2;
|
|
string name=3;
|
|
int64 show_type=4;
|
|
string cover=5;
|
|
int64 update_at=6;
|
|
int64 created_at=7;
|
|
}
|
|
|
|
message ListTagsReq {
|
|
int64 page_index =1;
|
|
int64 page_size =2;
|
|
repeated string ids=3;
|
|
optional string name=4;
|
|
optional int32 types=5;
|
|
optional int64 show_type=6;
|
|
}
|
|
|
|
message ListTagsResp {
|
|
int64 total =1;
|
|
repeated Tags data=3;
|
|
}
|
|
|
|
|
|
service Product {
|
|
// ====================== Category Service Start ======================
|
|
// CreateCategory 建立 product 分類
|
|
rpc CreateCategory(CreateCategoryReq) returns(OKResp);
|
|
// ModifyCategory 修改 product 分類名稱
|
|
rpc ModifyCategory(ModifyCategoryReq) returns(OKResp);
|
|
// DeleteCategory 刪除 product 分類
|
|
rpc DeleteCategory(CategoryReq) returns(OKResp);
|
|
// GetCategory 取得 product 分類
|
|
rpc GetCategory(CategoryReq) returns(Category);
|
|
// ListCategory 建立 product 分類
|
|
rpc ListCategory(ListCategoryReq) returns(ListCategoryResp);
|
|
// ====================== Category Service End ======================
|
|
// ====================== Tags Service Start ======================
|
|
// CreateTags 建立 tags
|
|
rpc CreateTags(CreateTagsReq) returns(OKResp);
|
|
// ModifyTags 修改 tags
|
|
rpc ModifyTags(ModifyTagsReq) returns(OKResp);
|
|
// DeleteTags 刪除tags
|
|
rpc DeleteTags(TagsReq) returns(OKResp);
|
|
// GetTags 取得 tags
|
|
rpc GetTags(TagsReq) returns(Tags);
|
|
// ListTags 建立 tags
|
|
rpc ListTags(ListTagsReq) returns(ListTagsResp);
|
|
// ====================== Tags Service End ======================
|
|
|
|
} |