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

@ -112,13 +112,13 @@ message GetOrderResp {
optional string chain_fee_crypto = 32; // 使
optional string memo = 33; //
optional string order_note = 34; //
int64 create_time = 35; //
int64 update_time = 36; //
int64 create_time = 35; //
int64 update_time = 36; //
}
message ListOrderReq {
int64 page_index = 1; // required
int64 page_size = 2; // required
int64 page_index = 1; // required
int64 page_size = 2; // required
string reference_id = 3;
string reference_uid = 4;
@ -142,7 +142,7 @@ message ListOrderReq {
}
message ListOrderResp {
repeated GetOrderResp data = 1; //
repeated GetOrderResp data = 1; //
Pager page = 2;
}
@ -165,42 +165,42 @@ service OrderService {
}
// ========== ===========
message CreateWalletReq{
repeated WalletItem item =1;
message CreateWalletReq {
repeated WalletItem item = 1;
}
message WalletItem {
string source = 1; //
string uid = 2; // UID
string currency_type = 3; //
string current_balance = 4; //
int64 wallet_type = 5; // 1. 2. 3.
string source = 1; //
string uid = 2; // UID
string currency_type = 3; //
string current_balance = 4; //
int64 wallet_type = 5; // 1. 2. 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;//
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; //
}
message QueryBalanceByDateReq{
string uid =1; // UID
string currency_type = 2; //
message QueryBalanceByDateReq {
string uid = 1; // UID
string currency_type = 2; //
}
message QueryBalanceByDateResp {
string currency_type = 1; //
string available = 2; //
UnavailableBalance unavailable = 3; //
int64 update_time=4;
string currency_type = 1; //
string available = 2; //
UnavailableBalance unavailable = 3; //
int64 update_time = 4;
}
message UnavailableBalance{
string freeze = 1; //
string unconfirmed = 2; //
message UnavailableBalance {
string freeze = 1; //
string unconfirmed = 2; //
}
// TODO
@ -233,36 +233,43 @@ service WalletService {
// ========== ===========
message StockAdjustmentReq {
string product_id = 1; // ID
int64 quantity = 2; // 調 ()
string product_id = 1; // ID
int64 quantity = 2; // 調 ()
}
message StockQueryReq {
string product_id = 1; // ID
string product_id = 1; // ID
}
message StockResp {
string product_id = 1; // ID
int64 available_quantity = 2; //
int64 reserved_quantity = 3; //
string product_id = 1; // ID
int64 available_quantity = 2; //
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;
repeated StockResp stock_items = 1; //
Pager page = 2;
}
message StockReservationReq {
string product_id = 1; // ID
int64 quantity = 2; //
string product_id = 1; // ID
int64 quantity = 2; //
}
message BatchStockAdjustmentReq {
repeated StockAdjustmentReq adjustments = 1; // 調
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 ()
@ -283,53 +290,78 @@ service InventoryService {
//
message ProductCreateReq {
string name = 1; //
string category = 2; //
string description = 3; //
double price = 4; //
string name = 1; //
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; //
string product_id = 1; // ID
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 {
string product_id = 1; // ID
string product_id = 1; // ID
}
message ProductQueryReq {
string product_id = 1; // ID
string product_id = 1; // ID
}
message ProductResp {
string product_id = 1; // ID
string name = 2; //
string category = 3; //
string description = 4; //
double price = 5; //
bool is_available = 6; //
string product_id = 1; // ID
string name = 2; //
string description = 3; //
string content = 4; //
double price = 5; //
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; //
repeated ProductResp products = 1; //
Pager page = 2;
}
service ProductService {
@ -342,71 +374,64 @@ 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);
}
// ========== ===========
//
message SubscriptionCreateReq {
string user_id = 1; // 使ID
string plan_id = 2; // ID
string start_date = 3; //
string user_id = 1; // 使ID
string plan_id = 2; // ID
string start_date = 3; //
}
message SubscriptionUpdateReq {
string subscription_id = 1; // ID
string plan_id = 2; // ID
string subscription_id = 1; // ID
string plan_id = 2; // ID
}
message SubscriptionCancelReq {
string subscription_id = 1; // ID
string subscription_id = 1; // ID
}
message SubscriptionQueryReq {
string subscription_id = 1; // ID
string subscription_id = 1; // ID
}
message SubscriptionResp {
string subscription_id = 1; // ID
string user_id = 2; // 使ID
string plan_id = 3; // ID
string start_date = 4; //
string end_date = 5; //
string status = 6; // (: "active", "expired", "canceled")
string subscription_id = 1; // ID
string user_id = 2; // 使ID
string plan_id = 3; // ID
string start_date = 4; //
string end_date = 5; //
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 {
repeated SubscriptionResp subscriptions = 1; //
repeated SubscriptionResp subscriptions = 1; //
Pager page = 2;
}
message SubscriptionRenewReq {
string subscription_id = 1; // ID
string renewal_date = 2; //
string subscription_id = 1; // ID
string renewal_date = 2; //
}
message SubscriptionStatusQueryReq {
string subscription_id = 1; // ID
string subscription_id = 1; // ID
}
message SubscriptionStatusResp {
string subscription_id = 1; // ID
string status = 2; //
string message = 3; //
string subscription_id = 1; // ID
string status = 2; //
string message = 3; //
}
service SubscriptionService {