2024-10-05 06:55:28 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
package tweeting;
|
|
|
|
option go_package = "./tweeting";
|
|
|
|
|
|
|
|
// ========== 基本回應 ===========
|
|
|
|
message OKResp {}
|
|
|
|
|
|
|
|
// 空的請求
|
|
|
|
message NoneReq {}
|
|
|
|
|
|
|
|
// 分頁信息
|
|
|
|
message Pager
|
|
|
|
{
|
|
|
|
int64 total = 1; // 總數量
|
|
|
|
int64 size = 2; // 每頁數量
|
|
|
|
int64 index = 3; // 當前頁碼
|
|
|
|
}
|
|
|
|
|
2024-10-06 07:02:30 +00:00
|
|
|
message CreateOrderReq{}
|
|
|
|
message CreateOrderResp{}
|
2024-10-05 06:55:28 +00:00
|
|
|
|
2024-10-06 07:02:30 +00:00
|
|
|
message CancelOrderReq{}
|
|
|
|
message ModifyOrderReq{}
|
|
|
|
message ModifyOrderStatusReq{}
|
|
|
|
message DeleteOrderReq{}
|
|
|
|
|
|
|
|
message GetOrderReq{}
|
|
|
|
message GetOrderResp{}
|
|
|
|
|
|
|
|
message ListOrderReq{}
|
|
|
|
message ListOrderResp{}
|
|
|
|
|
|
|
|
|
|
|
|
message OrderStatusTimeoutReq{}
|
2024-10-05 06:55:28 +00:00
|
|
|
|
|
|
|
// OrderService 訂單服務(業務邏輯在外面組合)
|
2024-10-06 07:02:30 +00:00
|
|
|
service OrderService{
|
|
|
|
// CreateOrder 建立訂單
|
|
|
|
rpc CreateOrder(CreateOrderReq)returns(CreateOrderResp);
|
|
|
|
// CancelOrder 取消訂單
|
|
|
|
rpc CancelOrder(CancelOrderReq)returns(OKResp);
|
|
|
|
// ModifyOrder 修改訂單
|
|
|
|
rpc ModifyOrder(ModifyOrderReq)returns(OKResp);
|
|
|
|
// ModifyOrderStatus 修改訂單狀態
|
|
|
|
rpc ModifyOrderStatus(ModifyOrderStatusReq)returns(OKResp);
|
|
|
|
// DeleteOrder 刪除訂單(軟刪除)
|
|
|
|
rpc DeleteOrder(DeleteOrderReq)returns(OKResp);
|
|
|
|
// GetOrder 取得訂單詳情
|
|
|
|
rpc GetOrder(GetOrderReq)returns(GetOrderResp);
|
|
|
|
// ListOrder 取得訂單列表
|
|
|
|
rpc ListOrder(ListOrderReq)returns(ListOrderResp);
|
|
|
|
// OrderStatusTimeout 訂單超時任務/cron/order-status/timeout
|
|
|
|
rpc OrderStatusTimeout(OrderStatusTimeoutReq)returns(OKResp);
|
|
|
|
}
|