初始化项目

This commit is contained in:
2025-12-10 13:51:09 +08:00
parent 3c55577df8
commit 0486f468d6
19 changed files with 1078 additions and 1010 deletions

View File

@@ -1,7 +1,7 @@
package entity
import (
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/v2/bson"
"time"
)
@@ -12,18 +12,18 @@ import (
// 例如orders_pending, orders_paid, orders_shipped, orders_completed, orders_cancelled
type OrderBase struct {
ID primitive.ObjectID `bson:"_id,omitempty" json:"id"`
TenantID string `bson:"tenant_id" json:"tenant_id"` // 租户ID
OrderNo string `bson:"order_no" json:"order_no"` // 订单号
UserID string `bson:"user_id" json:"user_id"` // 用户ID
TotalAmount int64 `bson:"total_amount" json:"total_amount"` // 订单总金额(分)
PayAmount int64 `bson:"pay_amount" json:"pay_amount"` // 实付金额(分)
OrderType string `bson:"order_type" json:"order_type"` // 订单类型normal-普通订单
Subject string `bson:"subject" json:"subject"` // 订单标题
Description string `bson:"description" json:"description"` // 订单描述
CreatedAt time.Time `bson:"created_at" json:"created_at"` // 创建时间
UpdatedAt time.Time `bson:"updated_at" json:"updated_at"` // 更新时间
ExpiredAt *time.Time `bson:"expired_at,omitempty" json:"expired_at"` // 过期时间
ID bson.ObjectID `bson:"_id,omitempty" json:"id"`
TenantID string `bson:"tenant_id" json:"tenant_id"` // 租户ID
OrderNo string `bson:"order_no" json:"order_no"` // 订单号
UserID string `bson:"user_id" json:"user_id"` // 用户ID
TotalAmount int64 `bson:"total_amount" json:"total_amount"` // 订单总金额(分)
PayAmount int64 `bson:"pay_amount" json:"pay_amount"` // 实付金额(分)
OrderType string `bson:"order_type" json:"order_type"` // 订单类型normal-普通订单
Subject string `bson:"subject" json:"subject"` // 订单标题
Description string `bson:"description" json:"description"` // 订单描述
CreatedAt time.Time `bson:"created_at" json:"created_at"` // 创建时间
UpdatedAt time.Time `bson:"updated_at" json:"updated_at"` // 更新时间
ExpiredAt *time.Time `bson:"expired_at,omitempty" json:"expired_at"` // 过期时间
}
// OrderItem 订单商品项