update product service proto

This commit is contained in:
daniel.w 2024-10-25 16:21:12 +08:00
parent e01d14ab90
commit 25b422b907
1 changed files with 130 additions and 105 deletions

View File

@ -247,6 +247,12 @@ message StockResp {
int64 reserved_quantity = 3; // int64 reserved_quantity = 3; //
} }
message StockListReq {
int64 page_index = 1; // required
int64 page_size = 2; // required
repeated string product_id = 3; //
}
message StockListResp { message StockListResp {
repeated StockResp stock_items = 1; // repeated StockResp stock_items = 1; //
Pager page = 2; Pager page = 2;
@ -261,8 +267,9 @@ message BatchStockAdjustmentReq {
repeated StockAdjustmentReq adjustments = 1; // 調 repeated StockAdjustmentReq adjustments = 1; // 調
} }
service InventoryService { service InventoryService {
// CreateStock
rpc CreateStock(StockAdjustmentReq) returns (OKResp);
// AddStock // AddStock
rpc AddStock(StockAdjustmentReq) returns (OKResp); rpc AddStock(StockAdjustmentReq) returns (OKResp);
// ReduceStock // ReduceStock
@ -270,7 +277,7 @@ service InventoryService {
// QueryStock // QueryStock
rpc QueryStock(StockQueryReq) returns (StockResp); rpc QueryStock(StockQueryReq) returns (StockResp);
// ListAllStock // ListAllStock
rpc ListAllStock(NoneReq) returns (StockListResp); rpc ListAllStock(StockListReq) returns (StockListResp);
// ReserveStock () // ReserveStock ()
rpc ReserveStock(StockReservationReq) returns (OKResp); rpc ReserveStock(StockReservationReq) returns (OKResp);
// ReleaseReservedStock () // ReleaseReservedStock ()
@ -284,17 +291,34 @@ service InventoryService {
// //
message ProductCreateReq { message ProductCreateReq {
string name = 1; // string name = 1; //
string category = 2; // string description = 2; //
string description = 3; // string content = 3; //
double price = 4; // double price = 4; //
int64 amount_type = 5; // 1 2
string currency = 6; // ( USD, TWD)
repeated string brand = 7; // channel_id or uid
repeated string category = 8; //
repeated string tags = 9; // 便
string sku = 10; // Stock Keeping Unit
repeated string images = 11; //
optional string coupon_id = 12; // id
} }
message ProductUpdateReq { message ProductUpdateReq {
string product_id = 1; // ID string product_id = 1; // ID
string name = 2; // optional string name = 2; //
string category = 3; // optional string description = 3; //
string description = 4; // optional string content = 4; //
double price = 5; // optional double price = 5; //
optional int64 amount_type = 6; // 1 2
optional string currency = 7; // ( USD, TWD)
repeated string brand = 8; // channel_id or uid
repeated string category = 9; //
repeated string tags = 10; // 便
optional string sku = 11; // Stock Keeping Unit
repeated string images = 12; //
optional string coupon_id = 13; // id
optional bool is_available = 14; //
} }
message ProductDeleteReq { message ProductDeleteReq {
@ -308,28 +332,36 @@ message ProductQueryReq {
message ProductResp { message ProductResp {
string product_id = 1; // ID string product_id = 1; // ID
string name = 2; // string name = 2; //
string category = 3; // string description = 3; //
string description = 4; // string content = 4; //
double price = 5; // double price = 5; //
bool is_available = 6; // int64 amount_type = 6; // 1 2
repeated string currency = 7; // ( USD, TWD)
repeated string brand = 8; // channel_id or uid
string category = 9; //
repeated string tags = 10; // 便
string sku = 11; // Stock Keeping Unit
repeated string images = 12; //
string coupon_id = 13; // id
bool is_available = 14; //
}
message ProductListReq {
int64 page_index = 1;
int64 page_size = 2;
repeated string product_id = 3; // ID
optional bool is_available = 4; //
repeated string tags = 5; // 便
optional int64 amount_type = 6; // 1 2
repeated string currency = 7; // ( USD, TWD)
repeated string brand = 8; // channel_id or uid
repeated string category = 9; //
} }
message ProductListResp { message ProductListResp {
repeated ProductResp products = 1; // repeated ProductResp products = 1; //
} Pager page = 2;
message CategoryQueryReq {
string category = 1; //
}
message ProductPriceUpdateReq {
string product_id = 1; // ID
double new_price = 2; //
}
message ProductStatusUpdateReq {
string product_id = 1; // ID
bool is_available = 2; //
} }
service ProductService { service ProductService {
@ -342,13 +374,7 @@ service ProductService {
// QueryProduct // QueryProduct
rpc QueryProduct(ProductQueryReq) returns (ProductResp); rpc QueryProduct(ProductQueryReq) returns (ProductResp);
// ListAllProducts // ListAllProducts
rpc ListAllProducts(NoneReq) returns (ProductListResp); rpc ListAllProducts(ProductListReq) returns (ProductListResp);
// ListProductsByCategory
rpc ListProductsByCategory(CategoryQueryReq) returns (ProductListResp);
// UpdateProductPrice
rpc UpdateProductPrice(ProductPriceUpdateReq) returns (OKResp);
// UpdateProductStatus (/)
rpc UpdateProductStatus(ProductStatusUpdateReq) returns (OKResp);
} }
// ========== =========== // ========== ===========
@ -382,7 +408,6 @@ message SubscriptionResp {
string status = 6; // (: "active", "expired", "canceled") string status = 6; // (: "active", "expired", "canceled")
} }
message ListSubscriptionsReq { message ListSubscriptionsReq {
int64 page_index = 1; int64 page_index = 1;
int64 page_size = 2; int64 page_size = 2;