Help us shape the future of Go! Take the 2026 Go Developer Survey

models

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

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

Code generated by genx:model@devel DO NOT EDIT.

Code generated by genx:model@devel DO NOT EDIT.

Code generated by genx:model@devel DO NOT EDIT.

Code generated by genx:model@devel DO NOT EDIT.

Code generated by genx:model@devel DO NOT EDIT.

Code generated by genx:doc@devel 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
View Source
var TagsOrder = map[string]string{
	"f_id":         "f_id",
	"user_id":      "user_id",
	"order_id":     "order_id",
	"order_no":     "order_no",
	"orderNO":      "order_no",
	"amount":       "amount",
	"currency":     "currency",
	"paid_at":      "paid_at",
	"paidAt":       "paid_at",
	"canceled_at":  "canceled_at",
	"canceledAt":   "canceled_at",
	"status":       "status",
	"f_created_at": "f_created_at",
	"createdAt":    "f_created_at",
	"f_updated_at": "f_updated_at",
	"updatedAt":    "f_updated_at",
}
View Source
var TagsOrderSnapshot = map[string]string{
	"f_id":         "f_id",
	"order_id":     "order_id",
	"product_id":   "product_id",
	"product_sku":  "product_sku",
	"product_name": "product_name",
	"price":        "price",
	"quantity":     "quantity",
	"subtotal":     "subtotal",
	"f_created_at": "f_created_at",
	"createdAt":    "f_created_at",
}
View Source
var TagsProduct = map[string]string{
	"f_id":         "f_id",
	"product_id":   "product_id",
	"sku":          "sku",
	"name":         "name",
	"description":  "description",
	"price":        "price",
	"currency":     "currency",
	"status":       "status",
	"f_created_at": "f_created_at",
	"createdAt":    "f_created_at",
	"f_updated_at": "f_updated_at",
	"updatedAt":    "f_updated_at",
	"f_deleted_at": "f_deleted_at",
	"deletedAt":    "f_deleted_at",
}
View Source
var TagsShipment = map[string]string{
	"f_id":         "f_id",
	"order_id":     "order_id",
	"tracking_no":  "tracking_no",
	"carrier":      "carrier",
	"status":       "status",
	"shipped_at":   "shipped_at",
	"delivered_at": "delivered_at",
	"f_created_at": "f_created_at",
	"createdAt":    "f_created_at",
	"f_updated_at": "f_updated_at",
	"updatedAt":    "f_updated_at",
}
View Source
var TagsUser = map[string]string{
	"f_id":         "f_id",
	"user_id":      "user_id",
	"username":     "username",
	"email":        "email",
	"phone":        "phone",
	"status":       "status",
	"f_created_at": "f_created_at",
	"createdAt":    "f_created_at",
	"f_updated_at": "f_updated_at",
	"updatedAt":    "f_updated_at",
	"f_deleted_at": "f_deleted_at",
	"deletedAt":    "f_deleted_at",
}

Functions

This section is empty.

Types

type Order

Order 订单 +genx:model @model TableName=t_order @model Register=Catalog @model pk=ID @model uidx=ui_order_id;OrderID @model idx=i_status;Status @model idx=i_created_at;CreatedAt @model idx=i_updated_at;UpdatedAt

func (Order) ColumnRel added in v0.3.1

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

ColumnRel presents soft foreign key of columns

func (*Order) Count added in v0.2.8

func (m *Order) Count(ctx context.Context, cond builder.SqlCondition) (int64, error)

Count record count of Order match condition

func (*Order) Create

func (m *Order) Create(ctx context.Context) error

Create inserts Order to database

func (*Order) DeleteByID

func (m *Order) DeleteByID(ctx context.Context) error

DeleteByID delete Order recode by Order.ID

func (*Order) DeleteByOrderID

func (m *Order) DeleteByOrderID(ctx context.Context) error

DeleteByOrderID delete Order recode by Order.OrderID

func (*Order) DocOf added in v0.2.3

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

func (*Order) FetchByID

func (m *Order) FetchByID(ctx context.Context) error

FetchByID fetch Order by Order.ID

func (*Order) FetchByOrderID

func (m *Order) FetchByOrderID(ctx context.Context) error

FetchByOrderID fetch Order by Order.OrderID

func (Order) Indexes

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

Indexes returns index list of Order

func (*Order) List

func (m *Order) List(ctx context.Context, cond builder.SqlCondition, adds builder.Additions, expects ...builder.Col) ([]Order, error)

List fetch Order datalist with condition and additions

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

func (*Order) UpdateAndFetchByID

func (m *Order) UpdateAndFetchByID(ctx context.Context, targets ...builder.Col) error

UpdateAndFetchByID update Order by Order.ID and retrieve record

func (*Order) UpdateAndFetchByOrderID

func (m *Order) UpdateAndFetchByOrderID(ctx context.Context, targets ...builder.Col) error

UpdateAndFetchByOrderID update Order by Order.OrderID and retrieve record

func (*Order) UpdateByID

func (m *Order) UpdateByID(ctx context.Context, expects ...builder.Col) error

UpdateByID update Order by Order.ID

func (*Order) UpdateByOrderID

func (m *Order) UpdateByOrderID(ctx context.Context, expects ...builder.Col) error

UpdateByOrderID update Order by Order.OrderID

type OrderID

type OrderID uint64

func (*OrderID) DocOf added in v0.2.3

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

type OrderMeta added in v0.3.7

type OrderMeta struct {
	// Amount 订单金额
	Amount types.Decimal `db:"amount,width=22,precision=4" json:"amount"`
	// Currency 结算币种
	Currency enums.Currency `db:"currency" json:"currency"`
}

func (*OrderMeta) DocOf added in v0.3.7

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

type OrderSnapshot

OrderSnapshot 订单快照 +genx:model @model TableName=t_order_snapshot @model Register=Catalog @model pk=ID @model uidx=ui_order_id;OrderID @model idx=i_product_name;ProductName @model idx=i_created_at;CreatedAt

func (OrderSnapshot) ColumnRel added in v0.3.1

func (m OrderSnapshot) ColumnRel() map[string][]string

ColumnRel presents soft foreign key of columns

func (*OrderSnapshot) Count added in v0.2.8

func (m *OrderSnapshot) Count(ctx context.Context, cond builder.SqlCondition) (int64, error)

Count record count of OrderSnapshot match condition

func (*OrderSnapshot) Create

func (m *OrderSnapshot) Create(ctx context.Context) error

Create inserts OrderSnapshot to database

func (*OrderSnapshot) DeleteByID

func (m *OrderSnapshot) DeleteByID(ctx context.Context) error

DeleteByID delete OrderSnapshot recode by OrderSnapshot.ID

func (*OrderSnapshot) DeleteByOrderID

func (m *OrderSnapshot) DeleteByOrderID(ctx context.Context) error

DeleteByOrderID delete OrderSnapshot recode by OrderSnapshot.OrderID

func (*OrderSnapshot) DocOf added in v0.2.3

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

func (*OrderSnapshot) FetchByID

func (m *OrderSnapshot) FetchByID(ctx context.Context) error

FetchByID fetch OrderSnapshot by OrderSnapshot.ID

func (*OrderSnapshot) FetchByOrderID

func (m *OrderSnapshot) FetchByOrderID(ctx context.Context) error

FetchByOrderID fetch OrderSnapshot by OrderSnapshot.OrderID

func (OrderSnapshot) Indexes

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

Indexes returns index list of OrderSnapshot

func (*OrderSnapshot) List

func (m *OrderSnapshot) List(ctx context.Context, cond builder.SqlCondition, adds builder.Additions, expects ...builder.Col) ([]OrderSnapshot, error)

List fetch OrderSnapshot datalist with condition and additions

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

func (*OrderSnapshot) UpdateAndFetchByID

func (m *OrderSnapshot) UpdateAndFetchByID(ctx context.Context, targets ...builder.Col) error

UpdateAndFetchByID update OrderSnapshot by OrderSnapshot.ID and retrieve record

func (*OrderSnapshot) UpdateAndFetchByOrderID

func (m *OrderSnapshot) UpdateAndFetchByOrderID(ctx context.Context, targets ...builder.Col) error

UpdateAndFetchByOrderID update OrderSnapshot by OrderSnapshot.OrderID and retrieve record

func (*OrderSnapshot) UpdateByID

func (m *OrderSnapshot) UpdateByID(ctx context.Context, expects ...builder.Col) error

UpdateByID update OrderSnapshot by OrderSnapshot.ID

func (*OrderSnapshot) UpdateByOrderID

func (m *OrderSnapshot) UpdateByOrderID(ctx context.Context, expects ...builder.Col) error

UpdateByOrderID update OrderSnapshot by OrderSnapshot.OrderID

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 OrderState added in v0.3.7

type OrderState struct {
	// PaidAt 订单支付时间
	PaidAt sqltime.Timestamp `db:"paid_at,default=0" json:"paidAt"`
	// CanceledAt 订单取消时间
	CanceledAt sqltime.Timestamp `db:"canceled_at,default=0" json:"canceledAt"`
	// Status 订单状态
	Status enums.OrderStatus `db:"status" json:"status"`
}

func (*OrderState) DocOf added in v0.3.7

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

type Product

Product 商品 +genx:model @model TableName=t_product @model Register=Catalog @model pk=ID @model uidx=ui_product_id;ProductID;DeletedAt @model idx=i_product_name;Name @model idx=i_status;Status @model idx=i_updated_at;UpdatedAt

func (Product) ColumnRel added in v0.3.1

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

ColumnRel presents soft foreign key of columns

func (*Product) Count added in v0.2.8

func (m *Product) Count(ctx context.Context, cond builder.SqlCondition) (int64, error)

Count record count of Product match condition

func (*Product) Create

func (m *Product) Create(ctx context.Context) error

Create inserts Product to database

func (*Product) DeleteByID

func (m *Product) DeleteByID(ctx context.Context) error

DeleteByID delete Product recode by Product.ID

func (*Product) DeleteByProductIDAndDeletedAt added in v0.3.7

func (m *Product) DeleteByProductIDAndDeletedAt(ctx context.Context) error

DeleteByProductIDAndDeletedAt delete Product recode by Product.ProductID and Product.DeletedAt

func (*Product) DocOf added in v0.2.3

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

func (*Product) FetchByID

func (m *Product) FetchByID(ctx context.Context) error

FetchByID fetch Product by Product.ID

func (*Product) FetchByProductIDAndDeletedAt added in v0.3.7

func (m *Product) FetchByProductIDAndDeletedAt(ctx context.Context) error

FetchByProductIDAndDeletedAt fetch Product by Product.ProductID and Product.DeletedAt

func (Product) Indexes

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

Indexes returns index list of Product

func (*Product) List

func (m *Product) List(ctx context.Context, cond builder.SqlCondition, adds builder.Additions, expects ...builder.Col) ([]Product, error)

List fetch Product datalist with condition and additions

func (*Product) MarkDeletionByID

func (m *Product) MarkDeletionByID(ctx context.Context) error

MarkDeletionByID marks Product as deleted

func (*Product) MarkDeletionByProductIDAndDeletedAt added in v0.3.7

func (m *Product) MarkDeletionByProductIDAndDeletedAt(ctx context.Context) error

MarkDeletionByProductIDAndDeletedAt marks Product as deleted

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

func (*Product) UpdateAndFetchByID

func (m *Product) UpdateAndFetchByID(ctx context.Context, targets ...builder.Col) error

UpdateAndFetchByID update Product by Product.ID and retrieve record

func (*Product) UpdateAndFetchByProductIDAndDeletedAt added in v0.3.7

func (m *Product) UpdateAndFetchByProductIDAndDeletedAt(ctx context.Context, targets ...builder.Col) error

UpdateAndFetchByProductIDAndDeletedAt update Product by Product.ProductID and Product.DeletedAt and retrieve record

func (*Product) UpdateByID

func (m *Product) UpdateByID(ctx context.Context, expects ...builder.Col) error

UpdateByID update Product by Product.ID

func (*Product) UpdateByProductIDAndDeletedAt added in v0.3.7

func (m *Product) UpdateByProductIDAndDeletedAt(ctx context.Context, expects ...builder.Col) error

UpdateByProductIDAndDeletedAt update Product by Product.ProductID and Product.DeletedAt

type ProductID

type ProductID int64

func (*ProductID) DocOf added in v0.2.3

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

type ProductMeta added in v0.3.7

type ProductMeta struct {
	// SKU 库存标签
	SKU string `db:"sku"`
	// Name 产品名称
	Name string `db:"name,width=256"`
	// Description 产品描述
	Description string `db:"description"`
}

func (*ProductMeta) DocOf added in v0.3.7

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

type ProductState added in v0.3.7

type ProductState struct {
	// Price 单价
	Price types.Decimal `db:"price,width=22,precision=4"`
	// Currency 货币
	Currency enums.Currency `db:"currency"`
	// Status 产品销售状态
	Status enums.ProductStatus `db:"status"`
}

func (*ProductState) DocOf added in v0.3.7

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

type RelOrder

type RelOrder struct {
	// @model 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 RelOrderNo added in v0.3.7

type RelOrderNo struct {
	// OrderNo 订单编号
	// @model rel=Order.OrderNo
	OrderNo string `db:"order_no,width=64" json:"orderNO"`
}

func (*RelOrderNo) DocOf added in v0.3.7

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

type RelProduct

type RelProduct struct {
	// @model 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 RelShipmentNo added in v0.3.7

type RelShipmentNo struct {
	// TrackingNo 物流单号
	// @model rel=Shipment.TrackingNo
	TrackingNo string `db:"tracking_no,width=128"`
}

func (*RelShipmentNo) DocOf added in v0.3.7

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

type RelUser

type RelUser struct {
	// @model 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 @model TableName=t_shipment @model Register=Catalog @model pk=ID @model uidx=ui_order_id;OrderID @model uidx=ui_tracking_no;TrackingNo @model idx=i_carrier;Carrier @model idx=i_status;Status @model idx=i_shipped_at;ShippedAt @model idx=i_delivered_at;DeliveredAt

func (Shipment) ColumnRel added in v0.3.1

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

ColumnRel presents soft foreign key of columns

func (*Shipment) Count added in v0.2.8

func (m *Shipment) Count(ctx context.Context, cond builder.SqlCondition) (int64, error)

Count record count of Shipment match condition

func (*Shipment) Create

func (m *Shipment) Create(ctx context.Context) error

Create inserts Shipment to database

func (*Shipment) DeleteByID

func (m *Shipment) DeleteByID(ctx context.Context) error

DeleteByID delete Shipment recode by Shipment.ID

func (*Shipment) DeleteByOrderID

func (m *Shipment) DeleteByOrderID(ctx context.Context) error

DeleteByOrderID delete Shipment recode by Shipment.OrderID

func (*Shipment) DeleteByTrackingNo

func (m *Shipment) DeleteByTrackingNo(ctx context.Context) error

DeleteByTrackingNo delete Shipment recode by Shipment.TrackingNo

func (*Shipment) DocOf added in v0.2.3

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

func (*Shipment) FetchByID

func (m *Shipment) FetchByID(ctx context.Context) error

FetchByID fetch Shipment by Shipment.ID

func (*Shipment) FetchByOrderID

func (m *Shipment) FetchByOrderID(ctx context.Context) error

FetchByOrderID fetch Shipment by Shipment.OrderID

func (*Shipment) FetchByTrackingNo

func (m *Shipment) FetchByTrackingNo(ctx context.Context) error

FetchByTrackingNo fetch Shipment by Shipment.TrackingNo

func (Shipment) Indexes

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

Indexes returns index list of Shipment

func (*Shipment) List

func (m *Shipment) List(ctx context.Context, cond builder.SqlCondition, adds builder.Additions, expects ...builder.Col) ([]Shipment, error)

List fetch Shipment datalist with condition and additions

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

func (*Shipment) UpdateAndFetchByID

func (m *Shipment) UpdateAndFetchByID(ctx context.Context, targets ...builder.Col) error

UpdateAndFetchByID update Shipment by Shipment.ID and retrieve record

func (*Shipment) UpdateAndFetchByOrderID

func (m *Shipment) UpdateAndFetchByOrderID(ctx context.Context, targets ...builder.Col) error

UpdateAndFetchByOrderID update Shipment by Shipment.OrderID and retrieve record

func (*Shipment) UpdateAndFetchByTrackingNo

func (m *Shipment) UpdateAndFetchByTrackingNo(ctx context.Context, targets ...builder.Col) error

UpdateAndFetchByTrackingNo update Shipment by Shipment.TrackingNo and retrieve record

func (*Shipment) UpdateByID

func (m *Shipment) UpdateByID(ctx context.Context, expects ...builder.Col) error

UpdateByID update Shipment by Shipment.ID

func (*Shipment) UpdateByOrderID

func (m *Shipment) UpdateByOrderID(ctx context.Context, expects ...builder.Col) error

UpdateByOrderID update Shipment by Shipment.OrderID

func (*Shipment) UpdateByTrackingNo

func (m *Shipment) UpdateByTrackingNo(ctx context.Context, expects ...builder.Col) error

UpdateByTrackingNo update Shipment by Shipment.TrackingNo

type ShipmentMeta added in v0.3.7

type ShipmentMeta struct {
	// Carrier 物流运营商
	Carrier string `db:"carrier,width=64"`
}

func (*ShipmentMeta) DocOf added in v0.3.7

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

type ShipmentState added in v0.3.7

type ShipmentState struct {
	// Status 物流状态
	Status enums.ShipmentStatus `db:"status"`
	// ShippedAt 开始运输时间
	ShippedAt sqltime.Timestamp `db:"shipped_at"`
	// DeliveredAt 抵达时间
	DeliveredAt sqltime.Timestamp `db:"delivered_at"`
}

func (*ShipmentState) DocOf added in v0.3.7

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

type User

User 用户 +genx:model @model TableName=t_user @model Register=Catalog @model pk=ID @model uidx=ui_user_id;UserID @model idx=ui_username,BTREE;Username @model idx=i_status;Status,NULLS,FIRST @model idx=i_created_at;CreatedAt

func (User) ColumnRel added in v0.3.1

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

ColumnRel presents soft foreign key of columns

func (*User) Count added in v0.2.8

func (m *User) Count(ctx context.Context, cond builder.SqlCondition) (int64, error)

Count record count of User match condition

func (*User) Create

func (m *User) Create(ctx context.Context) error

Create inserts User to database

func (*User) DeleteByID

func (m *User) DeleteByID(ctx context.Context) error

DeleteByID delete User recode by User.ID

func (*User) DeleteByUserID

func (m *User) DeleteByUserID(ctx context.Context) error

DeleteByUserID delete User recode by User.UserID

func (*User) DocOf added in v0.2.3

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

func (*User) FetchByID

func (m *User) FetchByID(ctx context.Context) error

FetchByID fetch User by User.ID

func (*User) FetchByUserID

func (m *User) FetchByUserID(ctx context.Context) error

FetchByUserID fetch User by User.UserID

func (User) Indexes

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

Indexes returns index list of User

func (*User) List

func (m *User) List(ctx context.Context, cond builder.SqlCondition, adds builder.Additions, expects ...builder.Col) ([]User, error)

List fetch User datalist with condition and additions

func (*User) MarkDeletionByID

func (m *User) MarkDeletionByID(ctx context.Context) error

MarkDeletionByID marks User as deleted

func (*User) MarkDeletionByUserID

func (m *User) MarkDeletionByUserID(ctx context.Context) error

MarkDeletionByUserID marks User as deleted

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

func (*User) UpdateAndFetchByID

func (m *User) UpdateAndFetchByID(ctx context.Context, targets ...builder.Col) error

UpdateAndFetchByID update User by User.ID and retrieve record

func (*User) UpdateAndFetchByUserID

func (m *User) UpdateAndFetchByUserID(ctx context.Context, targets ...builder.Col) error

UpdateAndFetchByUserID update User by User.UserID and retrieve record

func (*User) UpdateByID

func (m *User) UpdateByID(ctx context.Context, expects ...builder.Col) error

UpdateByID update User by User.ID

func (*User) UpdateByUserID

func (m *User) UpdateByUserID(ctx context.Context, expects ...builder.Col) error

UpdateByUserID update User by User.UserID

type UserID

type UserID uint64

func (*UserID) DocOf added in v0.2.3

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

type UserMeta added in v0.3.7

type UserMeta struct {
	// Username 用户名
	Username string `db:"username,width=127"`
	// Email 邮箱
	Email string `db:"email,width=127"`
	// Phone 电话
	Phone string `db:"phone,width=32"`
}

func (*UserMeta) DocOf added in v0.3.7

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

type UserState added in v0.3.7

type UserState struct {
	// Status 用户状态
	Status enums.UserStatus `db:"status"`
}

func (*UserState) DocOf added in v0.3.7

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

Jump to

Keyboard shortcuts

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