37 lines
1.7 KiB
Go
37 lines
1.7 KiB
Go
|
|
package entity
|
|||
|
|
|
|||
|
|
import (
|
|||
|
|
"time"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
// OrderCompleted 已完成订单
|
|||
|
|
// 对应MongoDB集合:orders_completed
|
|||
|
|
// 用户确认收货后订单进入此状态
|
|||
|
|
|
|||
|
|
type OrderCompleted struct {
|
|||
|
|
OrderBase // 基础订单信息
|
|||
|
|
PayMethod string `bson:"pay_method" json:"pay_method"` // 支付方式:wechat/alipay
|
|||
|
|
OrderItems []OrderItem `bson:"order_items" json:"order_items"` // 订单商品列表
|
|||
|
|
ShippingInfo *ShippingInfo `bson:"shipping_info,omitempty" json:"shipping_info"` // 收货信息
|
|||
|
|
|
|||
|
|
// 支付成功信息
|
|||
|
|
PaidAt time.Time `bson:"paid_at" json:"paid_at"` // 支付时间
|
|||
|
|
TransactionID string `bson:"transaction_id" json:"transaction_id"` // 支付平台交易号
|
|||
|
|
TradeNo string `bson:"trade_no" json:"trade_no"` // 交易号
|
|||
|
|
PaymentChannel string `bson:"payment_channel" json:"payment_channel"` // 支付渠道:wechat/alipay
|
|||
|
|
|
|||
|
|
// 发货信息
|
|||
|
|
ShippedAt time.Time `bson:"shipped_at" json:"shipped_at"` // 发货时间
|
|||
|
|
ExpressCompany string `bson:"express_company" json:"express_company"` // 快递公司
|
|||
|
|
ExpressNo string `bson:"express_no" json:"express_no"` // 快递单号
|
|||
|
|
ShippingCost int64 `bson:"shipping_cost" json:"shipping_cost"` // 运费(分)
|
|||
|
|
|
|||
|
|
// 完成特有字段
|
|||
|
|
CompletedAt time.Time `bson:"completed_at" json:"completed_at"` // 完成时间
|
|||
|
|
ReceivedAt time.Time `bson:"received_at" json:"received_at"` // 收货时间
|
|||
|
|
|
|||
|
|
// 评价相关字段
|
|||
|
|
Rating int `bson:"rating,omitempty" json:"rating"` // 评分(1-5)
|
|||
|
|
Comment string `bson:"comment,omitempty" json:"comment"` // 评价内容
|
|||
|
|
}
|