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 chain_fee_crypto = 32; // 使
optional string memo = 33; // optional string memo = 33; //
optional string order_note = 34; // optional string order_note = 34; //
int64 create_time = 35; // int64 create_time = 35; //
int64 update_time = 36; // int64 update_time = 36; //
} }
message ListOrderReq { message ListOrderReq {
int64 page_index = 1; // required int64 page_index = 1; // required
int64 page_size = 2; // required int64 page_size = 2; // required
string reference_id = 3; string reference_id = 3;
string reference_uid = 4; string reference_uid = 4;
@ -142,7 +142,7 @@ message ListOrderReq {
} }
message ListOrderResp { message ListOrderResp {
repeated GetOrderResp data = 1; // repeated GetOrderResp data = 1; //
Pager page = 2; Pager page = 2;
} }
@ -165,42 +165,42 @@ service OrderService {
} }
// ========== =========== // ========== ===========
message CreateWalletReq{ message CreateWalletReq {
repeated WalletItem item =1; repeated WalletItem item = 1;
} }
message WalletItem { message WalletItem {
string source = 1; // string source = 1; //
string uid = 2; // UID string uid = 2; // UID
string currency_type = 3; // string currency_type = 3; //
string current_balance = 4; // string current_balance = 4; //
int64 wallet_type = 5; // 1. 2. 3. int64 wallet_type = 5; // 1. 2. 3.
} }
message WalletTransactionReq{ message WalletTransactionReq {
string uid =1; // UID string uid = 1; // UID
optional string order_id =2; // optional string order_id = 2; //
optional string business_type =3; // optional string business_type = 3; //
optional string currency_type = 4; // optional string currency_type = 4; //
optional string amount = 5; // optional string amount = 5; //
optional int64 wallet_type = 6;// optional int64 wallet_type = 6; //
} }
message QueryBalanceByDateReq{ message QueryBalanceByDateReq {
string uid =1; // UID string uid = 1; // UID
string currency_type = 2; // string currency_type = 2; //
} }
message QueryBalanceByDateResp { message QueryBalanceByDateResp {
string currency_type = 1; // string currency_type = 1; //
string available = 2; // string available = 2; //
UnavailableBalance unavailable = 3; // UnavailableBalance unavailable = 3; //
int64 update_time=4; int64 update_time = 4;
} }
message UnavailableBalance{ message UnavailableBalance {
string freeze = 1; // string freeze = 1; //
string unconfirmed = 2; // string unconfirmed = 2; //
} }
// TODO // TODO
@ -233,36 +233,43 @@ service WalletService {
// ========== =========== // ========== ===========
message StockAdjustmentReq { message StockAdjustmentReq {
string product_id = 1; // ID string product_id = 1; // ID
int64 quantity = 2; // 調 () int64 quantity = 2; // 調 ()
} }
message StockQueryReq { message StockQueryReq {
string product_id = 1; // ID string product_id = 1; // ID
} }
message StockResp { message StockResp {
string product_id = 1; // ID string product_id = 1; // ID
int64 available_quantity = 2; // int64 available_quantity = 2; //
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;
} }
message StockReservationReq { message StockReservationReq {
string product_id = 1; // ID string product_id = 1; // ID
int64 quantity = 2; // int64 quantity = 2; //
} }
message BatchStockAdjustmentReq { 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 ()
@ -283,53 +290,78 @@ 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 {
string product_id = 1; // ID string product_id = 1; // ID
} }
message ProductQueryReq { message ProductQueryReq {
string product_id = 1; // ID string product_id = 1; // ID
} }
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,71 +374,64 @@ 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);
} }
// ========== =========== // ========== ===========
// //
message SubscriptionCreateReq { message SubscriptionCreateReq {
string user_id = 1; // 使ID string user_id = 1; // 使ID
string plan_id = 2; // ID string plan_id = 2; // ID
string start_date = 3; // string start_date = 3; //
} }
message SubscriptionUpdateReq { message SubscriptionUpdateReq {
string subscription_id = 1; // ID string subscription_id = 1; // ID
string plan_id = 2; // ID string plan_id = 2; // ID
} }
message SubscriptionCancelReq { message SubscriptionCancelReq {
string subscription_id = 1; // ID string subscription_id = 1; // ID
} }
message SubscriptionQueryReq { message SubscriptionQueryReq {
string subscription_id = 1; // ID string subscription_id = 1; // ID
} }
message SubscriptionResp { message SubscriptionResp {
string subscription_id = 1; // ID string subscription_id = 1; // ID
string user_id = 2; // 使ID string user_id = 2; // 使ID
string plan_id = 3; // ID string plan_id = 3; // ID
string start_date = 4; // string start_date = 4; //
string end_date = 5; // string end_date = 5; //
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;
optional string uid=3; optional string uid = 3;
} }
message SubscriptionListResp { message SubscriptionListResp {
repeated SubscriptionResp subscriptions = 1; // repeated SubscriptionResp subscriptions = 1; //
Pager page = 2; Pager page = 2;
} }
message SubscriptionRenewReq { message SubscriptionRenewReq {
string subscription_id = 1; // ID string subscription_id = 1; // ID
string renewal_date = 2; // string renewal_date = 2; //
} }
message SubscriptionStatusQueryReq { message SubscriptionStatusQueryReq {
string subscription_id = 1; // ID string subscription_id = 1; // ID
} }
message SubscriptionStatusResp { message SubscriptionStatusResp {
string subscription_id = 1; // ID string subscription_id = 1; // ID
string status = 2; // string status = 2; //
string message = 3; // string message = 3; //
} }
service SubscriptionService { service SubscriptionService {