Documentation
¶
Overview ¶
Code generated by genx:model DO NOT EDIT.
Code generated by genx:model DO NOT EDIT.
Code generated by genx:model DO NOT EDIT.
Code generated by genx:model DO NOT EDIT.
Code generated by genx:model DO NOT EDIT.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Catalog = builder.NewCatalog()
var TOrder *tOrder
var TOrderSnapshot *tOrderSnapshot
var TProduct *tProduct
var TShipment *tShipment
var TUser *tUser
Functions ¶
This section is empty.
Types ¶
type Order ¶
Order 订单 +genx:model @attr TableName=t_order @attr Register=Catalog @def pk ID @def u_idx ui_order_id OrderID @def idx i_status Status @def idx i_created_at CreatedAt @def idx i_updated_at UpdatedAt
func (Order) PrimaryKey ¶
PrimaryKey returns column list of Order's primary key
func (Order) UniqueIndexes ¶
UniqueIndexes returns unique index list of Order
type OrderData ¶
type OrderData struct {
// OrderNo 订单编号
OrderNo string `db:"order_no,width=64"`
// Amount 订单金额
Amount types.Decimal `db:"amount,width=22,precision=4"`
// Currency 结算币种
Currency enums.Currency `db:"currency"`
// PaidAt 订单支付时间
PaidAt sqltime.Timestamp `db:"paid_at,default=0"`
// CanceledAt 订单取消时间
CanceledAt sqltime.Timestamp `db:"canceled_at,default=0"`
// Status 订单状态
Status enums.OrderStatus `db:"status"`
}
type OrderSnapshot ¶
type OrderSnapshot struct {
types.AutoIncID
RelOrder
RelProduct
OrderSnapshotData
types.CreationTime
}
OrderSnapshot 订单快照 +genx:model @attr TableName=t_order_snapshot @attr Register=Catalog @def pk ID @def u_idx ui_order_id OrderID @def idx i_product_name ProductName @def idx i_created_at CreatedAt
func (OrderSnapshot) Indexes ¶
func (m OrderSnapshot) Indexes() map[string][]string
Indexes returns index list of OrderSnapshot
func (OrderSnapshot) PrimaryKey ¶
func (m OrderSnapshot) PrimaryKey() []string
PrimaryKey returns column list of OrderSnapshot's primary key
func (OrderSnapshot) TableDesc ¶
func (m OrderSnapshot) TableDesc() []string
TableDesc returns descriptions of OrderSnapshot
func (OrderSnapshot) TableName ¶
func (m OrderSnapshot) TableName() string
TableName returns database table name of OrderSnapshot
func (OrderSnapshot) UniqueIndexes ¶
func (m OrderSnapshot) UniqueIndexes() map[string][]string
UniqueIndexes returns unique index list of OrderSnapshot
type OrderSnapshotData ¶
type OrderSnapshotData struct {
// ProductSKU 产品SKU
ProductSKU string `db:"product_sku,width=64"`
// ProductName 产品名称 Product.Name
ProductName string `db:"product_name,width=256"`
// Price 产品单价 Product.Price
Price types.Decimal `db:"price,width=22,precision=4"`
// Quantity 订单产品数量
Quantity int64 `db:"quantity"`
// Subtotal 订单金额
Subtotal types.Decimal `db:"subtotal,width=22,precision=4"`
}
type Product ¶
type Product struct {
types.AutoIncID
RelProduct
ProductData
types.CreationModificationDeletionTime
}
Product 商品 +genx:model @attr TableName=t_product @attr Register=Catalog @def pk ID @def u_idx ui_product_id ProductID,DeletedAt @def idx i_product_name Name @def idx i_status Status @def idx i_updated_at UpdatedAt
func (Product) PrimaryKey ¶
PrimaryKey returns column list of Product's primary key
func (Product) UniqueIndexes ¶
UniqueIndexes returns unique index list of Product
type ProductData ¶
type ProductData struct {
// SKU 库存标签
SKU string `db:"sku"`
// Name 产品名称
Name string `db:"name,width=256"`
// Description 产品描述
Description string `db:"description"`
// Price 单价
Price types.Decimal `db:"price,width=22,precision=4"`
// Currency 货币
Currency enums.Currency `db:"currency"`
// Status 产品销售状态
Status enums.ProductStatus `db:"status"`
}
type RelProduct ¶
type RelProduct struct {
// @rel Product.ProductID
ProductID ProductID `db:"product_id"`
}
type Shipment ¶
type Shipment struct {
types.AutoIncID
RelOrder
ShipmentData
types.CreationModificationTime
}
Shipment 物流 +genx:model @attr TableName=t_shipment @attr Register=Catalog @def pk ID @def u_idx ui_order_id OrderID @def u_idx ui_tracking_no TrackingNo @def idx i_carrier Carrier @def idx i_status Status @def idx i_shipped_at ShippedAt @def idx i_delivered_at DeliveredAt
func (Shipment) PrimaryKey ¶
PrimaryKey returns column list of Shipment's primary key
func (Shipment) UniqueIndexes ¶
UniqueIndexes returns unique index list of Shipment
type ShipmentData ¶
type ShipmentData struct {
// Carrier 物流运营商
Carrier string `db:"carrier,width=64"`
// TrackingNo 物流单号
TrackingNo string `db:"tracking_no"`
// Status 物流状态
Status enums.ShipmentStatus `db:"status"`
// ShippedAt 开始运输时间
ShippedAt sqltime.Timestamp `db:"shipped_at"`
// DeliveredAt 抵达时间
DeliveredAt sqltime.Timestamp `db:"delivered_at"`
}
type User ¶
User 用户 +genx:model @attr TableName=t_user @attr Register=Catalog @def pk ID @def u_idx ui_user_id UserID @def idx ui_username Username @def idx i_status Status @def idx i_created_at CreatedAt
func (User) PrimaryKey ¶
PrimaryKey returns column list of User's primary key
func (User) UniqueIndexes ¶
UniqueIndexes returns unique index list of User