Documentation ¶
Index ¶
- type CancelOrderReq
- type CloseTimeoutOrdersReq
- type CompleteOrderReq
- type CreateOrderReq
- type CreateOrderResp
- type Handler
- func (h *Handler) CancelOrder(ctx *ginx.Context, req CancelOrderReq, sess session.Session) (ginx.Result, error)
- func (h *Handler) CloseTimeoutOrders(ctx *ginx.Context, req CloseTimeoutOrdersReq) (ginx.Result, error)
- func (h *Handler) CompleteOrder(ctx *ginx.Context, req CompleteOrderReq) (ginx.Result, error)
- func (h *Handler) CreateOrderAndPayment(ctx *ginx.Context, req CreateOrderReq, sess session.Session) (ginx.Result, error)
- func (h *Handler) ListOrders(ctx *ginx.Context, req ListOrdersReq, sess session.Session) (ginx.Result, error)
- func (h *Handler) PrivateRoutes(server *gin.Engine)
- func (h *Handler) RetrieveOrderDetail(ctx *ginx.Context, req RetrieveOrderDetailReq, sess session.Session) (ginx.Result, error)
- func (h *Handler) RetrieveOrderStatus(ctx *ginx.Context, req RetrieveOrderStatusReq, sess session.Session) (ginx.Result, error)
- func (h *Handler) RetrievePreviewOrder(ctx *ginx.Context, req PreviewOrderReq, sess session.Session) (ginx.Result, error)
- type ListOrdersReq
- type ListOrdersResp
- type Order
- type OrderItem
- type Payment
- type PreviewOrderReq
- type PreviewOrderResp
- type Product
- type RetrieveOrderDetailReq
- type RetrieveOrderDetailResp
- type RetrieveOrderStatusReq
- type RetrieveOrderStatusResp
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloseTimeoutOrdersReq ¶
type CloseTimeoutOrdersReq struct { Limit int `json:"limit,omitempty"` Minute int64 `json:"minute"` }
CloseTimeoutOrdersReq 关闭超时订单
type CompleteOrderReq ¶
CompleteOrderReq 完成订单
type CreateOrderReq ¶
type CreateOrderReq struct { RequestID string `json:"requestID"` // 请求去重,防止订单重复提交 Products []Product `json:"products"` // 商品信息 Payments []Payment `json:"paymentChannels"` // 支付通道 OriginalTotalPrice int64 `json:"originalTotalPrice"` RealTotalPrice int64 `json:"realTotalPrice"` }
CreateOrderReq 创建订单请求
type CreateOrderResp ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) CancelOrder ¶
func (h *Handler) CancelOrder(ctx *ginx.Context, req CancelOrderReq, sess session.Session) (ginx.Result, error)
CancelOrder 取消订单
func (*Handler) CloseTimeoutOrders ¶
func (h *Handler) CloseTimeoutOrders(ctx *ginx.Context, req CloseTimeoutOrdersReq) (ginx.Result, error)
CloseTimeoutOrders 关闭超时订单
func (*Handler) CompleteOrder ¶
CompleteOrder 完成订单
func (*Handler) CreateOrderAndPayment ¶
func (h *Handler) CreateOrderAndPayment(ctx *ginx.Context, req CreateOrderReq, sess session.Session) (ginx.Result, error)
CreateOrderAndPayment 创建订单和支付
func (*Handler) ListOrders ¶
func (h *Handler) ListOrders(ctx *ginx.Context, req ListOrdersReq, sess session.Session) (ginx.Result, error)
ListOrders 分页查询用户订单
func (*Handler) PrivateRoutes ¶
func (*Handler) RetrieveOrderDetail ¶
func (h *Handler) RetrieveOrderDetail(ctx *ginx.Context, req RetrieveOrderDetailReq, sess session.Session) (ginx.Result, error)
RetrieveOrderDetail 查看订单详情
type ListOrdersReq ¶
type ListOrdersReq struct { Offset int `json:"offset,omitempty"` Limit int `json:"limit,omitempty"` }
ListOrdersReq 分页查询用户所有订单
type ListOrdersResp ¶
type Order ¶
type Order struct { SN string `json:"sn"` PaymentSN string `json:"paymentSn"` OriginalTotalPrice int64 `json:"originalPrice"` RealTotalPrice int64 `json:"realPrice"` Status int64 `json:"status"` Items []OrderItem `json:"items"` Payments []Payment `json:"payments"` Ctime int64 `json:"ctime"` Utime int64 `json:"utime"` }
type PreviewOrderReq ¶
PreviewOrderReq 预览订单请求
type PreviewOrderResp ¶
type RetrieveOrderDetailReq ¶
type RetrieveOrderDetailReq struct {
OrderSN string `json:"sn"`
}
RetrieveOrderDetailReq 获取订单详情
type RetrieveOrderDetailResp ¶
type RetrieveOrderDetailResp struct {
Order Order `json:"order"`
}
type RetrieveOrderStatusReq ¶
type RetrieveOrderStatusReq struct {
OrderSN string `json:"sn"`
}
RetrieveOrderStatusReq 获取订单状态
type RetrieveOrderStatusResp ¶
type RetrieveOrderStatusResp struct {
OrderStatus int64 `json:"status"`
}
Click to show internal directories.
Click to hide internal directories.