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

@ -165,8 +165,8 @@ service OrderService {
}
// ========== ===========
message CreateWalletReq{
repeated WalletItem item =1;
message CreateWalletReq {
repeated WalletItem item = 1;
}
message WalletItem {
@ -177,17 +177,17 @@ message WalletItem {
int64 wallet_type = 5; // 1. 2. 3.
}
message WalletTransactionReq{
string uid =1; // UID
optional string order_id =2; //
optional string business_type =3; //
message WalletTransactionReq {
string uid = 1; // UID
optional string order_id = 2; //
optional string business_type = 3; //
optional string currency_type = 4; //
optional string amount = 5; //
optional int64 wallet_type = 6;//
optional int64 wallet_type = 6; //
}
message QueryBalanceByDateReq{
string uid =1; // UID
message QueryBalanceByDateReq {
string uid = 1; // UID
string currency_type = 2; //
}
@ -195,10 +195,10 @@ message QueryBalanceByDateResp {
string currency_type = 1; //
string available = 2; //
UnavailableBalance unavailable = 3; //
int64 update_time=4;
int64 update_time = 4;
}
message UnavailableBalance{
message UnavailableBalance {
string freeze = 1; //
string unconfirmed = 2; //
}
@ -247,9 +247,15 @@ message StockResp {
int64 reserved_quantity = 3; //
}
message StockListReq {
int64 page_index = 1; // required
int64 page_size = 2; // required
repeated string product_id = 3; //
}
message StockListResp {
repeated StockResp stock_items = 1; //
Pager page =2;
Pager page = 2;
}
message StockReservationReq {
@ -261,8 +267,9 @@ message BatchStockAdjustmentReq {
repeated StockAdjustmentReq adjustments = 1; // 調
}
service InventoryService {
// CreateStock
rpc CreateStock(StockAdjustmentReq) returns (OKResp);
// AddStock
rpc AddStock(StockAdjustmentReq) returns (OKResp);
// ReduceStock
@ -270,7 +277,7 @@ service InventoryService {
// QueryStock
rpc QueryStock(StockQueryReq) returns (StockResp);
// ListAllStock
rpc ListAllStock(NoneReq) returns (StockListResp);
rpc ListAllStock(StockListReq) returns (StockListResp);
// ReserveStock ()
rpc ReserveStock(StockReservationReq) returns (OKResp);
// ReleaseReservedStock ()
@ -284,17 +291,34 @@ service InventoryService {
//
message ProductCreateReq {
string name = 1; //
string category = 2; //
string description = 3; //
string description = 2; //
string content = 3; //
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 {
string product_id = 1; // ID
string name = 2; //
string category = 3; //
string description = 4; //
double price = 5; //
optional string name = 2; //
optional string description = 3; //
optional string content = 4; //
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 {
@ -308,28 +332,36 @@ message ProductQueryReq {
message ProductResp {
string product_id = 1; // ID
string name = 2; //
string category = 3; //
string description = 4; //
string description = 3; //
string content = 4; //
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 {
repeated ProductResp products = 1; //
}
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; //
Pager page = 2;
}
service ProductService {
@ -342,13 +374,7 @@ service ProductService {
// QueryProduct
rpc QueryProduct(ProductQueryReq) returns (ProductResp);
// ListAllProducts
rpc ListAllProducts(NoneReq) returns (ProductListResp);
// ListProductsByCategory
rpc ListProductsByCategory(CategoryQueryReq) returns (ProductListResp);
// UpdateProductPrice
rpc UpdateProductPrice(ProductPriceUpdateReq) returns (OKResp);
// UpdateProductStatus (/)
rpc UpdateProductStatus(ProductStatusUpdateReq) returns (OKResp);
rpc ListAllProducts(ProductListReq) returns (ProductListResp);
}
// ========== ===========
@ -382,11 +408,10 @@ message SubscriptionResp {
string status = 6; // (: "active", "expired", "canceled")
}
message ListSubscriptionsReq {
int64 page_index=1;
int64 page_size=2;
optional string uid=3;
int64 page_index = 1;
int64 page_size = 2;
optional string uid = 3;
}
message SubscriptionListResp {