2025-03-12 14:05:38 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package product;
|
|
|
|
option go_package="./product";
|
|
|
|
|
2025-04-06 02:08:46 +00:00
|
|
|
|
|
|
|
// OKResp
|
|
|
|
message OKResp {}
|
|
|
|
// NoneReq
|
|
|
|
message NoneReq {}
|
|
|
|
|
2025-04-08 02:06:40 +00:00
|
|
|
// ====================== Category Param ======================
|
2025-04-06 02:08:46 +00:00
|
|
|
message CreateCategoryReq {
|
|
|
|
string name = 1;
|
|
|
|
}
|
|
|
|
|
2025-04-08 02:06:40 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ====================== Category Param ======================
|
|
|
|
|
2025-04-06 02:08:46 +00:00
|
|
|
|
|
|
|
service Product {
|
2025-04-08 02:06:40 +00:00
|
|
|
// ====================== Category Service Start ======================
|
2025-04-06 02:08:46 +00:00
|
|
|
// CreateCategory 建立 product 分類
|
|
|
|
rpc CreateCategory(CreateCategoryReq) returns(OKResp);
|
2025-04-08 02:06:40 +00:00
|
|
|
// ModifyCategory 修改 product 分類名稱
|
|
|
|
rpc ModifyCategory(ModifyCategoryReq) returns(OKResp);
|
|
|
|
// DeleteCategory 刪除 product 分類
|
|
|
|
rpc DeleteCategory(CategoryReq) returns(OKResp);
|
|
|
|
// GetCategory 取得 product 分類
|
|
|
|
rpc GetCategory(CategoryReq) returns(Category);
|
|
|
|
// CreateCategory 建立 product 分類
|
|
|
|
rpc ListCategory(ListCategoryReq) returns(ListCategoryResp);
|
|
|
|
// ====================== Category Service End ======================
|
2025-04-06 02:08:46 +00:00
|
|
|
}
|