models

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package models defines model types for example testing +genx:doc

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.

Code generated by genx:doc DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var Catalog = builder.NewCatalog()
View Source
var TOrder *tOrder
View Source
var TOrderSnapshot *tOrderSnapshot
View Source
var TProduct *tProduct
View Source
var TShipment *tShipment
View Source
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) DocOf added in v0.2.3

func (v *Order) DocOf(names ...string) ([]string, bool)

func (Order) Indexes

func (m Order) Indexes() map[string][]string

Indexes returns index list of Order

func (Order) PrimaryKey

func (m Order) PrimaryKey() []string

PrimaryKey returns column list of Order's primary key

func (Order) TableDesc

func (m Order) TableDesc() []string

TableDesc returns descriptions of Order

func (Order) TableName

func (m Order) TableName() string

TableName returns database table name of Order

func (Order) UniqueIndexes

func (m Order) UniqueIndexes() map[string][]string

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"`
}

func (*OrderData) DocOf added in v0.2.3

func (v *OrderData) DocOf(names ...string) ([]string, bool)

type OrderID

type OrderID uint64

func (*OrderID) DocOf added in v0.2.3

func (v *OrderID) DocOf(names ...string) ([]string, bool)

type OrderSnapshot

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) DocOf added in v0.2.3

func (v *OrderSnapshot) DocOf(names ...string) ([]string, bool)

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"`
}

func (*OrderSnapshotData) DocOf added in v0.2.3

func (v *OrderSnapshotData) DocOf(names ...string) ([]string, bool)

type Product

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) DocOf added in v0.2.3

func (v *Product) DocOf(names ...string) ([]string, bool)

func (Product) Indexes

func (m Product) Indexes() map[string][]string

Indexes returns index list of Product

func (Product) PrimaryKey

func (m Product) PrimaryKey() []string

PrimaryKey returns column list of Product's primary key

func (Product) TableDesc

func (m Product) TableDesc() []string

TableDesc returns descriptions of Product

func (Product) TableName

func (m Product) TableName() string

TableName returns database table name of Product

func (Product) UniqueIndexes

func (m Product) UniqueIndexes() map[string][]string

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"`
}

func (*ProductData) DocOf added in v0.2.3

func (v *ProductData) DocOf(names ...string) ([]string, bool)

type ProductID

type ProductID int64

func (*ProductID) DocOf added in v0.2.3

func (v *ProductID) DocOf(names ...string) ([]string, bool)

type RelOrder

type RelOrder struct {
	// @rel Order.OrderID
	OrderID OrderID `db:"order_id"`
}

func (*RelOrder) DocOf added in v0.2.3

func (v *RelOrder) DocOf(names ...string) ([]string, bool)

type RelProduct

type RelProduct struct {
	// @rel Product.ProductID
	ProductID ProductID `db:"product_id"`
}

func (*RelProduct) DocOf added in v0.2.3

func (v *RelProduct) DocOf(names ...string) ([]string, bool)

type RelUser

type RelUser struct {
	// @rel User.UserID
	UserID UserID `db:"user_id"`
}

func (*RelUser) DocOf added in v0.2.3

func (v *RelUser) DocOf(names ...string) ([]string, bool)

type Shipment

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) DocOf added in v0.2.3

func (v *Shipment) DocOf(names ...string) ([]string, bool)

func (Shipment) Indexes

func (m Shipment) Indexes() map[string][]string

Indexes returns index list of Shipment

func (Shipment) PrimaryKey

func (m Shipment) PrimaryKey() []string

PrimaryKey returns column list of Shipment's primary key

func (Shipment) TableDesc

func (m Shipment) TableDesc() []string

TableDesc returns descriptions of Shipment

func (Shipment) TableName

func (m Shipment) TableName() string

TableName returns database table name of Shipment

func (Shipment) UniqueIndexes

func (m Shipment) UniqueIndexes() map[string][]string

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,width=128"`
	// Status 物流状态
	Status enums.ShipmentStatus `db:"status"`
	// ShippedAt 开始运输时间
	ShippedAt sqltime.Timestamp `db:"shipped_at"`
	// DeliveredAt 抵达时间
	DeliveredAt sqltime.Timestamp `db:"delivered_at"`
}

func (*ShipmentData) DocOf added in v0.2.3

func (v *ShipmentData) DocOf(names ...string) ([]string, bool)

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) DocOf added in v0.2.3

func (v *User) DocOf(names ...string) ([]string, bool)

func (User) Indexes

func (m User) Indexes() map[string][]string

Indexes returns index list of User

func (User) PrimaryKey

func (m User) PrimaryKey() []string

PrimaryKey returns column list of User's primary key

func (User) TableDesc

func (m User) TableDesc() []string

TableDesc returns descriptions of User

func (User) TableName

func (m User) TableName() string

TableName returns database table name of User

func (User) UniqueIndexes

func (m User) UniqueIndexes() map[string][]string

UniqueIndexes returns unique index list of User

type UserData

type UserData struct {
	// Username 用户名
	Username string `db:"username,width=127"`
	// Email 邮箱
	Email string `db:"email,width=127"`
	// Phone 电话
	Phone string `db:"phone,width=32"`
	// Status 用户状态
	Status enums.UserStatus `db:"status"`
}

func (*UserData) DocOf added in v0.2.3

func (v *UserData) DocOf(names ...string) ([]string, bool)

type UserID

type UserID uint64

func (*UserID) DocOf added in v0.2.3

func (v *UserID) DocOf(names ...string) ([]string, bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL