Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Order ¶ added in v0.3.0
type Order struct {
ID int64 `xorm:"pk autoincr"`
UserID string `xorm:"not null"`
Amount float64 `xorm:"not null"`
Status string `xorm:"not null default 'pending'"`
CreatedAt time.Time `xorm:"created"`
}
Order 订单模型
type OrderDao ¶ added in v0.3.0
type OrderDao struct{}
OrderDao 订单DAO
func (*OrderDao) CreateOrderWithItems ¶ added in v0.3.0
func (d *OrderDao) CreateOrderWithItems(ctx context.IContext, userID string, items []OrderItem) (*Order, error)
CreateOrderWithItems 创建订单及订单项(跨表事务示例) 这是使用新的 BeginTx 方法的完整示例
func (*OrderDao) SyncTables ¶ added in v0.3.0
SyncTables 同步表结构(演示使用)
type OrderItem ¶ added in v0.3.0
type OrderItem struct {
ID int64 `xorm:"pk autoincr"`
OrderID int64 `xorm:"not null"`
Product string `xorm:"not null"`
Quantity int `xorm:"not null"`
Price float64 `xorm:"not null"`
}
OrderItem 订单项模型
Click to show internal directories.
Click to hide internal directories.