model

package
v0.0.0-...-d5996f0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderWait    = iota // 0 初始值
	OrderSuccess        // 1
	OrderFailed         // 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	ProductID int64
	UserID    int64
}

func NewMessage

func NewMessage(userId int64, productId int64) *Message

type Order

type Order struct {
	ID          int64 `sql:"id"`
	UserId      int64 `sql:"user_id"`
	ProductId   int64 `sql:"product_id"`
	OrderStatus int   `sql:"order_status"`
}

type Product

type Product struct {
	// json用于JSON序列化 sql用于MySQL操作 form用于把form表单数据映射为Product模型
	ID           int64  `json:"id" sql:"id" form:"ID"`
	ProductName  string `json:"product_mame" sql:"product_name" form:"ProductName"`
	ProductNum   int64  `json:"product_num" sql:"product_num" form:"ProductNum"`
	ProductImage string `json:"product_image" sql:"product_image" form:"ProductImage"`
	ProductUrl   string `json:"product_url" sql:"product_url" form:"ProductUrl"`
}

商品模型

type User

type User struct {
	ID       int64  `json:"id" form:"ID" sql:"id"`
	NickName string `json:"nick_name" form:"NickName" sql:"nick_name"`
	UserName string `json:"user_name" form:"UserName" sql:"user_name"`
	// 密码 json不做映射
	HashPassword string `json:"-" form:"Password" sql:"password"`
}

Jump to

Keyboard shortcuts

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