model

package
v0.0.0-...-64e5d5b Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AutoCreateModelList = []interface{}{
	&BagM{},
	&BuyRecordM{},
	&ClassM{},
	&ConfigM{},
	&ImageM{},
	&MsgM{},
	&UserM{},
	&WupinM{},
	XieyiM{},
}

Functions

This section is empty.

Types

type Bag

type Bag struct {
	gorm.Model
	UserID    uint            `gorm:"not null"`
	User      *User           `gorm:"foreignKey:UserID"`
	WupinID   uint            `gorm:"not null"`
	Wupin     *Wupin          `gorm:"foreignKey:WupinID"`
	ClassID   uint            `gorm:"not null"`
	Class     *Class          `gorm:"foreignKey:ClassID"`
	Num       modeltype.Total `gorm:"type:uint;not null"`
	Time      time.Time       `gorm:"type:datetime;not null"`
	WupinDown bool            `gorm:"type:boolean;not null"`
	ClassDown bool            `gorm:"type:boolean;not null;"`
}

func NewBag

func NewBag(user *User, wupin *Wupin, num modeltype.Total) *Bag

func (*Bag) Add

func (bag *Bag) Add(num int) bool

func (*Bag) IsBagCanNotSale

func (bag *Bag) IsBagCanNotSale() bool

func (*Bag) IsBagCanSale

func (bag *Bag) IsBagCanSale() bool

func (*Bag) IsBagDown

func (bag *Bag) IsBagDown() bool

func (*Bag) IsBagNotShow

func (bag *Bag) IsBagNotShow() bool

func (*Bag) IsBagShow

func (bag *Bag) IsBagShow() bool

func (*Bag) TableName

func (*Bag) TableName() string

type BagM

type BagM struct {
	gorm.Model
	UserID    uint            `gorm:"not null"`
	WupinID   uint            `gorm:"not null"`
	ClassID   uint            `gorm:"not null"`
	Num       modeltype.Total `gorm:"type:uint;not null"`
	Time      time.Time       `gorm:"type:datetime;not null"`
	WupinDown bool            `gorm:"type:boolean;not null"`
	ClassDown bool            `gorm:"type:boolean;not null;"`
}

func (*BagM) TableName

func (*BagM) TableName() string

type BuyRecord

type BuyRecord struct {
	gorm.Model
	Status             modeltype.BuyStatus `gorm:"type:uint;not null;"`
	UserID             uint                `gorm:"not null"`
	User               *User               `gorm:"foreignKey:UserID"`
	WupinID            uint                `gorm:"not null"`
	Wupin              *Wupin              `gorm:"foreignKey:WupinID"`
	ClassID            uint                `gorm:"not null"`
	Class              *Class              `gorm:"foreignKey:ClassID"`
	Num                modeltype.Total     `gorm:"type:uint;not null"`
	Price              modeltype.Price     `gorm:"type:uint;not null"`
	TotalPrice         modeltype.Price     `gorm:"type:uint;not null"`
	XiaDanTime         time.Time           `gorm:"type:datetime;not null"`
	FuKuanTime         sql.NullTime        `gorm:"type:datetime;"`
	FaHuoTime          sql.NullTime        `gorm:"type:datetime;"`
	ShouHuoTime        sql.NullTime        `gorm:"type:datetime;"`
	PingJiaTime        sql.NullTime        `gorm:"type:datetime;"`
	TuiHuoShenQingTime sql.NullTime        `gorm:"type:datetime;"`
	QueRenTuiHuoTime   sql.NullTime        `gorm:"type:datetime;"`
	DengJiTuiHuoTime   sql.NullTime        `gorm:"type:datetime;"`
	TuiHuoTime         sql.NullTime        `gorm:"type:datetime;"`
	QuXiaoTime         sql.NullTime        `gorm:"type:datetime;"`
	FaHuoKuaiDi        sql.NullString      `gorm:"type:varchar(20);"`
	FaHuoKuaiDiNum     sql.NullString      `gorm:"type:varchar(50);"`
	TuiHuoKuaiDi       sql.NullString      `gorm:"type:varchar(20);"`
	TuiHuoKuaiDiNum    sql.NullString      `gorm:"type:varchar(50);"`
	IsGood             sql.NullBool        `gorm:"type:boolean;"`

	UserName     string         `gorm:"type:varchar(20);not null;"`
	UserPhone    string         `gorm:"type:varchar(30);not null"`
	UserWeChat   sql.NullString `gorm:"type:varchar(50);"`
	UserEmail    sql.NullString `gorm:"type:varchar(50);"`
	UserLocation string         `gorm:"type:varchar(200);not null;"`
	UserRemark   sql.NullString `gorm:"type:varchar(200);"`

	ShopName     string         `gorm:"type:varchar(20);not null;"`
	ShopPhone    string         `gorm:"type:varchar(30);not null"`
	ShopWeChat   sql.NullString `gorm:"type:varchar(50);"`
	ShopEmail    sql.NullString `gorm:"type:varchar(50);"`
	ShopLocation string         `gorm:"type:varchar(200);not null;"`
	ShopRemark   sql.NullString `gorm:"type:varchar(200);"`

	WupinName    string         `gorm:"type:varchar(20);not null"`
	WupinPic     string         `gorm:"type:varchar(150);not null"`
	WupinClassID uint           `gorm:"not null"`
	WupinClass   *Class         `gorm:"foreignKey:ClassID"`
	WupinTag     sql.NullString `gorm:"type:varchar(20)"`

	WupinHotPrice  modeltype.PriceNull `gorm:"type:uint;"`
	WupinRealPrice modeltype.Price     `gorm:"type:uint;not null;"`

	WupinInfo     string         `gorm:"type:text;not null"`
	WupinRen      string         `gorm:"type:varchar(20);not null"`
	WupinPhone    string         `gorm:"type:varchar(30);not null"`
	WupinWeChat   sql.NullString `gorm:"type:varchar(50);"`
	WupinEmail    sql.NullString `gorm:"type:varchar(50);"`
	WupinLocation string         `gorm:"type:varchar(200);not null"`

	WupinBuyTotal   modeltype.Total `gorm:"type:uint;not null"`
	WupinBuyDaoHuo  modeltype.Total `gorm:"type:uint;not null"`
	WupinBuyGood    modeltype.Total `gorm:"type:uint;not null"`
	WupinBuyPrice   modeltype.Price `gorm:"type:uint;not null"`
	WupinBuyPingJia modeltype.Total `gorm:"type:uint;not null"`
	WupinBuyJian    modeltype.Total `gorm:"type:uint;not null"`
	WupinHot        bool            `gorm:"type:boolean;not null"`

	WupinDown bool `gorm:"type:boolean;not null"` // 并非物品Lock信息
	ClassDown bool `gorm:"type:boolean;not null;"`
}

func NewBagBuyRecord

func NewBagBuyRecord(user *User, bag *Bag, username, userphone, userlocation, userwechat, useremail, userremark string) *BuyRecord

func NewBuyRecord

func NewBuyRecord(user *User, wupin *Wupin, num modeltype.Total, username, userphone, userlocation, userwechat, useremail, userremark string) *BuyRecord

func (*BuyRecord) AcceptQuXiao

func (r *BuyRecord) AcceptQuXiao() bool

func (*BuyRecord) AcceptTuiHuo

func (r *BuyRecord) AcceptTuiHuo() bool

func (*BuyRecord) BindUser

func (r *BuyRecord) BindUser(u *User)

func (*BuyRecord) ChangeShop

func (r *BuyRecord) ChangeShop(shopname, shopphone, shoplocation, shopwechat, shopemail, shopremark string) bool

func (*BuyRecord) ChangeUser

func (r *BuyRecord) ChangeUser(username, userphone, userlocation, userwechat, useremail, userremark string) bool

func (*BuyRecord) CheHuiFaHuo

func (r *BuyRecord) CheHuiFaHuo() bool

func (*BuyRecord) DaoHuo

func (r *BuyRecord) DaoHuo() bool

func (*BuyRecord) FaHuoDengJi

func (r *BuyRecord) FaHuoDengJi(kuaidi string, kuaidinum string) bool

func (*BuyRecord) GetBagPayUrl

func (r *BuyRecord) GetBagPayUrl(pft modeltype.PayFromType, redirect string) string

func (*BuyRecord) GetNewPayUrl

func (r *BuyRecord) GetNewPayUrl(pft modeltype.PayFromType, redirect string) string

func (*BuyRecord) GetRepayPayUrl

func (r *BuyRecord) GetRepayPayUrl(pft modeltype.PayFromType, redirect string) string

func (*BuyRecord) IsBuyRecordCanNotPay

func (r *BuyRecord) IsBuyRecordCanNotPay() bool

func (*BuyRecord) IsBuyRecordCanNotRepay

func (r *BuyRecord) IsBuyRecordCanNotRepay() bool

func (*BuyRecord) IsBuyRecordCanPay

func (r *BuyRecord) IsBuyRecordCanPay() bool

func (*BuyRecord) IsBuyRecordCanRepay

func (r *BuyRecord) IsBuyRecordCanRepay() bool

func (*BuyRecord) IsBuyRecordDown

func (*BuyRecord) IsBuyRecordDown() bool

func (*BuyRecord) IsWupinNotSale

func (r *BuyRecord) IsWupinNotSale() bool

func (*BuyRecord) IsWupinSale

func (r *BuyRecord) IsWupinSale() bool

func (*BuyRecord) NotAcceptTuiHuo

func (r *BuyRecord) NotAcceptTuiHuo() bool

func (*BuyRecord) NotQuXiaoFaHuo

func (r *BuyRecord) NotQuXiaoFaHuo() bool

func (*BuyRecord) PayFail

func (r *BuyRecord) PayFail() bool

func (*BuyRecord) PaySuccess

func (r *BuyRecord) PaySuccess() bool

func (*BuyRecord) PingJia

func (r *BuyRecord) PingJia(isGood bool) bool

func (*BuyRecord) QuXiaoFaHuo

func (r *BuyRecord) QuXiaoFaHuo() bool

func (*BuyRecord) QuXiaoPay

func (r *BuyRecord) QuXiaoPay() bool

func (*BuyRecord) Repay

func (r *BuyRecord) Repay()

func (*BuyRecord) TuiHuoDaoHuo

func (r *BuyRecord) TuiHuoDaoHuo() bool

func (*BuyRecord) TuiHuoDengJi

func (r *BuyRecord) TuiHuoDengJi(kuaidi string, kuaidinum string) bool

func (*BuyRecord) TuiHuoShenQing

func (r *BuyRecord) TuiHuoShenQing() bool

type BuyRecordM

type BuyRecordM struct {
	gorm.Model
	Status             modeltype.BuyStatus `gorm:"type:uint;not null;"`
	UserID             uint                `gorm:"not null"`
	WupinID            uint                `gorm:"not null"`
	ClassID            uint                `gorm:"not null"`
	Num                modeltype.Total     `gorm:"type:uint;not null"`
	Price              modeltype.Price     `gorm:"type:uint;not null"`
	TotalPrice         modeltype.Price     `gorm:"type:uint;not null"`
	XiaDanTime         time.Time           `gorm:"type:datetime;not null"`
	FuKuanTime         sql.NullTime        `gorm:"type:datetime;"`
	FaHuoTime          sql.NullTime        `gorm:"type:datetime;"`
	ShouHuoTime        sql.NullTime        `gorm:"type:datetime;"`
	PingJiaTime        sql.NullTime        `gorm:"type:datetime;"`
	TuiHuoShenQingTime sql.NullTime        `gorm:"type:datetime;"`
	QueRenTuiHuoTime   sql.NullTime        `gorm:"type:datetime;"`
	DengJiTuiHuoTime   sql.NullTime        `gorm:"type:datetime;"`
	TuiHuoTime         sql.NullTime        `gorm:"type:datetime;"`
	QuXiaoTime         sql.NullTime        `gorm:"type:datetime;"`
	FaHuoKuaiDi        sql.NullString      `gorm:"type:varchar(20);"`
	FaHuoKuaiDiNum     sql.NullString      `gorm:"type:varchar(50);"`
	TuiHuoKuaiDi       sql.NullString      `gorm:"type:varchar(20);"`
	TuiHuoKuaiDiNum    sql.NullString      `gorm:"type:varchar(50);"`
	IsGood             sql.NullBool        `gorm:"type:boolean;"`

	UserName     string         `gorm:"type:varchar(20);not null;"`
	UserPhone    string         `gorm:"type:varchar(30);not null"`
	UserWeChat   sql.NullString `gorm:"type:varchar(50);"`
	UserEmail    sql.NullString `gorm:"type:varchar(50);"`
	UserLocation string         `gorm:"type:varchar(200);not null;"`
	UserRemark   sql.NullString `gorm:"type:varchar(200);"`

	ShopName     string         `gorm:"type:varchar(20);not null;"`
	ShopPhone    string         `gorm:"type:varchar(30);not null"`
	ShopWeChat   sql.NullString `gorm:"type:varchar(50);"`
	ShopEmail    sql.NullString `gorm:"type:varchar(50);"`
	ShopLocation string         `gorm:"type:varchar(200);not null;"`
	ShopRemark   sql.NullString `gorm:"type:varchar(200);"`

	WupinName    string         `gorm:"type:varchar(20);not null"`
	WupinPic     string         `gorm:"type:varchar(150);not null"`
	WupinClassID uint           `gorm:"not null"`
	WupinTag     sql.NullString `gorm:"type:varchar(20)"`

	WupinHotPrice  modeltype.PriceNull `gorm:"type:uint;"`
	WupinRealPrice modeltype.Price     `gorm:"type:uint;not null;"`

	WupinInfo     string         `gorm:"type:text;not null"`
	WupinRen      string         `gorm:"type:varchar(20);not null"`
	WupinPhone    string         `gorm:"type:varchar(30);not null"`
	WupinWeChat   sql.NullString `gorm:"type:varchar(50);"`
	WupinEmail    sql.NullString `gorm:"type:varchar(50);"`
	WupinLocation string         `gorm:"type:varchar(200);not null"`

	WupinBuyTotal   modeltype.Total `gorm:"type:uint;not null"`
	WupinBuyDaoHuo  modeltype.Total `gorm:"type:uint;not null"`
	WupinBuyGood    modeltype.Total `gorm:"type:uint;not null"`
	WupinBuyPrice   modeltype.Price `gorm:"type:uint;not null"`
	WupinBuyPingJia modeltype.Total `gorm:"type:uint;not null"`
	WupinBuyJian    modeltype.Total `gorm:"type:uint;not null"`
	WupinHot        bool            `gorm:"type:boolean;not null"`

	WupinDown bool `gorm:"type:boolean;not null"`
	ClassDown bool `gorm:"type:boolean;not null;"`
}

func (*BuyRecordM) TableName

func (*BuyRecordM) TableName() string

type Class

type Class struct {
	gorm.Model
	Name      string `gorm:"type:varchar(20);not null"`
	Show      bool   `gorm:"type:boolean;not null"` // 仅不展示
	ClassDown bool   `gorm:"type:boolean;not null"` // 下架所有商品
}

func NewClass

func NewClass(name string, show bool, down bool) *Class

func NewEmptyClass

func NewEmptyClass() *Class

func (*Class) IsClassDown

func (cls *Class) IsClassDown() bool

func (*Class) IsClassDownOrNotShow

func (cls *Class) IsClassDownOrNotShow() bool

func (*Class) IsClassShow

func (cls *Class) IsClassShow() bool

func (*Class) IsEmpty

func (cls *Class) IsEmpty() bool

func (*Class) ResetIsEmpty

func (cls *Class) ResetIsEmpty() bool

func (*Class) TableName

func (*Class) TableName() string

func (*Class) UpdateInfo

func (cls *Class) UpdateInfo(name string, show bool, down bool) bool

type ClassM

type ClassM struct {
	gorm.Model
	Name      string `gorm:"type:varchar(20);not null"`
	Show      bool   `gorm:"type:boolean;not null"`
	ClassDown bool   `gorm:"type:boolean;not null"` // 下架所有商品
}

func (*ClassM) TableName

func (*ClassM) TableName() string

type Config

type Config struct {
	gorm.Model
	Key   modeltype.ConfigKeyType          `gorm:"type:varchar(20);not null;uniqueIndex"`
	Value modeltype.ConfigValueType        `gorm:"type:varchar(20);not null"`
	Type  modeltype.TypesOfConfigValueType `gorm:"type:varchar(20);not null"`
}

func (*Config) Default

func (c *Config) Default() modeltype.ConfigValueType

func (*Config) GetValue

func (c *Config) GetValue() modeltype.ConfigValueType

type ConfigM

type ConfigM struct {
	gorm.Model
	Key   modeltype.ConfigKeyType          `gorm:"type:varchar(20);not null;uniqueIndex"`
	Value modeltype.ConfigValueType        `gorm:"type:varchar(20);not null"`
	Type  modeltype.TypesOfConfigValueType `gorm:"type:varchar(20);not null"`
}

func (*ConfigM) TableName

func (*ConfigM) TableName() string

type Image

type Image struct {
	gorm.Model
	Type modeltype.ImageType `gorm:"type:uint;not null"`
	Hash string              `gorm:"type:char(64);not null"`
	Time time.Time           `gorm:"type:datetime;not null"`
}

func NewImage

func NewImage(tp modeltype.ImageType, file []byte) (*Image, error)

func (*Image) GetQuery

func (img *Image) GetQuery() string

func (*Image) GetUrl

func (img *Image) GetUrl() string

func (*Image) SavePath

func (img *Image) SavePath() string

func (*Image) TableName

func (*Image) TableName() string

type ImageM

type ImageM struct {
	gorm.Model
	Type modeltype.ImageType `gorm:"type:uint;not null"`
	Hash string              `gorm:"type:char(64);not null"`
	Time time.Time           `gorm:"type:datetime;not null"`
}

func (*ImageM) TableName

func (*ImageM) TableName() string

type Msg

type Msg struct {
	gorm.Model
	UserID uint      `gorm:"not null"`
	User   *User     `gorm:"foreignKey:UserID"`
	Msg    string    `gorm:"type:varchar(200);not null"`
	Time   time.Time `gorm:"type:datetime;not null"`
}

func NewMsg

func NewMsg(userID uint, msg string) *Msg

func (*Msg) TableName

func (*Msg) TableName() string

type MsgM

type MsgM struct {
	gorm.Model
	UserID uint      `gorm:"not null"`
	Msg    string    `gorm:"type:varchar(200);not null"`
	Time   time.Time `gorm:"type:datetime;not null"`
}

func (*MsgM) TableName

func (*MsgM) TableName() string

type User

type User struct {
	gorm.Model
	Status       modeltype.UserStatus `gorm:"type:uint;not null"`
	Type         modeltype.UserType   `gorm:"type:uint;not null"`
	Name         string               `gorm:"type:varchar(20);not null"`
	Phone        string               `gorm:"type:varchar(30);not null"`
	WeChat       sql.NullString       `gorm:"type:varchar(50);"`
	Email        sql.NullString       `gorm:"type:varchar(50);"`
	Location     sql.NullString       `gorm:"type:varchar(200);"`
	Avatar       sql.NullString       `gorm:"type:varchar(200);"`
	TotalPrice   modeltype.Price      `gorm:"type:uint;not null"`
	TotalBuy     modeltype.Total      `gorm:"type:uint;not null"`
	TotalGood    modeltype.Total      `gorm:"type:uint;not null"`
	TotalJian    modeltype.Total      `gorm:"type:uint;not null"`
	TotalDaohuo  modeltype.Total      `gorm:"type:uint;not null"`
	TotalPingJia modeltype.Total      `gorm:"type:uint;not null"`
	PasswordHash string               `gorm:"type:char(64);not null"`
}

func NewUser

func NewUser(phone string, password string) *User

func (*User) BuyNow

func (u *User) BuyNow(r *BuyRecord) bool

func (*User) BuyQuXiao

func (u *User) BuyQuXiao(r *BuyRecord) bool

func (*User) CanLogin

func (u *User) CanLogin() bool

func (*User) Daohuo

func (u *User) Daohuo() bool

func (*User) GetLongName

func (u *User) GetLongName() string

func (*User) HasPermission

func (u *User) HasPermission(admin *User) bool

func (*User) IsAdmin

func (u *User) IsAdmin() bool

func (*User) IsDeleteUser

func (u *User) IsDeleteUser() bool

func (*User) IsNormalAdmin

func (u *User) IsNormalAdmin() bool

func (*User) IsNormalUser

func (u *User) IsNormalUser() bool

func (*User) IsRootAdmin

func (u *User) IsRootAdmin() bool

func (*User) PasswordCheck

func (u *User) PasswordCheck(password string) bool

func (*User) PingJia

func (u *User) PingJia(isGood bool) bool

func (*User) SetNewPassword

func (u *User) SetNewPassword(password string) bool

func (*User) TableName

func (*User) TableName() string

func (*User) TuiHuoAfterFaHuo

func (u *User) TuiHuoAfterFaHuo(r *BuyRecord) bool

func (*User) TuiHuoBeforeFaHuo

func (u *User) TuiHuoBeforeFaHuo(r *BuyRecord) bool

func (*User) UpdateAvatar

func (u *User) UpdateAvatar(avatarUrl string) bool

func (*User) UpdateInfo

func (u *User) UpdateInfo(name string, wechat string, email string, location string)

func (*User) UpdatePassword

func (u *User) UpdatePassword(newPassword string)

func (*User) UpdatePasswordWithCheck

func (u *User) UpdatePasswordWithCheck(oldPassword string, newPassword string) bool

func (*User) UpdatePhone

func (u *User) UpdatePhone(phone string)

func (*User) UpdateStatus

func (u *User) UpdateStatus(st modeltype.UserStatus) bool

func (*User) UpdateStatusWithRoot

func (u *User) UpdateStatusWithRoot(st modeltype.UserStatus) bool

func (*User) UpdateType

func (u *User) UpdateType(tp modeltype.UserType) bool

type UserM

type UserM struct {
	gorm.Model
	Status       modeltype.UserStatus `gorm:"type:uint;not null"`
	Type         modeltype.UserType   `gorm:"type:uint;not null"`
	Name         string               `gorm:"type:varchar(20);not null"`
	Phone        string               `gorm:"type:varchar(30);not null"`
	WeChat       sql.NullString       `gorm:"type:varchar(50);"`
	Email        sql.NullString       `gorm:"type:varchar(50);"`
	Location     sql.NullString       `gorm:"type:varchar(200);"`
	Avatar       sql.NullString       `gorm:"type:varchar(200);"`
	TotalPrice   modeltype.Total      `gorm:"type:uint;not null"`
	TotalBuy     modeltype.Total      `gorm:"type:uint;not null"`
	TotalGood    modeltype.Total      `gorm:"type:uint;not null"`
	TotalJian    modeltype.Total      `gorm:"type:uint;not null"`
	TotalDaohuo  modeltype.Total      `gorm:"type:uint;not null"`
	TotalPingJia modeltype.Total      `gorm:"type:uint;not null"`
	PasswordHash string               `gorm:"type:char(64);not null"`
}

func (*UserM) TableName

func (*UserM) TableName() string

type Video

type Video struct {
	gorm.Model
	Type modeltype.VideoType `gorm:"type:uint;not null"`
	Hash string              `gorm:"type:char(64);not null"`
	Time time.Time           `gorm:"type:datetime;not null"`
}

func NewVideo

func NewVideo(tp modeltype.VideoType, file []byte) (*Video, error)

func (*Video) GetQuery

func (vid *Video) GetQuery() string

func (*Video) GetUrl

func (vid *Video) GetUrl() string

func (*Video) SavePath

func (vid *Video) SavePath() string

func (*Video) TableName

func (*Video) TableName() string

type VideoM

type VideoM struct {
	gorm.Model
	Type modeltype.VideoType `gorm:"type:uint;not null"`
	Hash string              `gorm:"type:char(64);not null"`
	Time time.Time           `gorm:"type:datetime;not null"`
}

func (*VideoM) TableName

func (*VideoM) TableName() string

type Wupin

type Wupin struct {
	gorm.Model
	Name    string         `gorm:"type:varchar(20);not null"`
	Pic     string         `gorm:"type:varchar(150);not null"`
	ClassID uint           `gorm:"not null"`
	Class   *Class         `gorm:"foreignKey:ClassID"`
	Tag     sql.NullString `gorm:"type:varchar(20)"`

	HotPrice  modeltype.PriceNull `gorm:"type:uint;"`
	RealPrice modeltype.Price     `gorm:"type:uint;not null;"`

	Info     string         `gorm:"type:text;not null"`
	Ren      string         `gorm:"type:varchar(20);not null"`
	Phone    string         `gorm:"type:varchar(30);not null"`
	WeChat   sql.NullString `gorm:"type:varchar(50);"`
	Email    sql.NullString `gorm:"type:varchar(50);"`
	Location string         `gorm:"type:varchar(200);not null"`

	BuyPrice   modeltype.Price `gorm:"type:uint;not null"` // 购物总金额
	BuyTotal   modeltype.Total `gorm:"type:uint;not null"` // 购物总人数
	BuyDaoHuo  modeltype.Total `gorm:"type:uint;not null"`
	BuyPingjia modeltype.Total `gorm:"type:uint;not null"`
	BuyGood    modeltype.Total `gorm:"type:uint;not null"`
	BuyJian    modeltype.Total `gorm:"type:uint;not null"`

	Hot       bool `gorm:"type:boolean;not null;"`
	WupinDown bool `gorm:"type:boolean;not null;"`
	ClassShow bool `gorm:"type:boolean;not null;"`
	ClassDown bool `gorm:"type:boolean;not null;"`
}

func NewWupin

func NewWupin(name string, pic string, class *Class, tag string, hotPrice modeltype.PriceNull, realPrice modeltype.Price, info string, ren string, phone string, email string, wechat string, location string, hot bool, down bool) *Wupin

func (*Wupin) BuyNow

func (w *Wupin) BuyNow(r *BuyRecord) bool

func (*Wupin) BuyQuXiao

func (w *Wupin) BuyQuXiao(r *BuyRecord) bool

func (*Wupin) Daohuo

func (w *Wupin) Daohuo() bool

func (*Wupin) GetFacePrice

func (w *Wupin) GetFacePrice() modeltype.Price

func (*Wupin) GetPrice

func (w *Wupin) GetPrice() modeltype.Price

func (*Wupin) GetPriceTotal

func (w *Wupin) GetPriceTotal(num modeltype.Total) modeltype.Price

func (*Wupin) GetRealPrice

func (w *Wupin) GetRealPrice() modeltype.Price

func (*Wupin) IsWupinCanNotSale

func (w *Wupin) IsWupinCanNotSale() bool

func (*Wupin) IsWupinCanSale

func (w *Wupin) IsWupinCanSale() bool

func (*Wupin) IsWupinDown

func (w *Wupin) IsWupinDown() bool

func (*Wupin) IsWupinHot

func (m *Wupin) IsWupinHot() bool

func (*Wupin) IsWupinShow

func (m *Wupin) IsWupinShow() bool

func (*Wupin) PingJia

func (w *Wupin) PingJia(isGood bool) bool

func (*Wupin) TableName

func (*Wupin) TableName() string

func (*Wupin) TuiHuoAfterFaHuo

func (w *Wupin) TuiHuoAfterFaHuo(r *BuyRecord) bool

func (*Wupin) TuiHuoBeforeFaHuo

func (w *Wupin) TuiHuoBeforeFaHuo(r *BuyRecord) bool

func (*Wupin) UpdateInfo

func (w *Wupin) UpdateInfo(name string, pic string, class *Class, tag string, hotPrice modeltype.PriceNull, realPrice modeltype.Price, info string, ren string, phone string, email string, wechat string, location string, hot bool, down bool) bool

func (*Wupin) UpdateNormalInfo

func (w *Wupin) UpdateNormalInfo(name string, pic string, class *Class, tag string, hotPrice modeltype.PriceNull, realPrice modeltype.Price, info string, hot bool, down bool) bool

func (*Wupin) UpdateShopInfo

func (w *Wupin) UpdateShopInfo(ren string, phone string, email string, wechat string, location string) bool

type WupinM

type WupinM struct {
	gorm.Model
	Name    string         `gorm:"type:varchar(20);not null"`
	Pic     string         `gorm:"type:varchar(150);not null"`
	ClassID uint           `gorm:"not null"`
	Tag     sql.NullString `gorm:"type:varchar(20)"`

	HotPrice  modeltype.PriceNull `gorm:"type:uint;"`
	RealPrice modeltype.Price     `gorm:"type:uint;not null;"`

	Info     string         `gorm:"type:text;not null"`
	Ren      string         `gorm:"type:varchar(20);not null"`
	Phone    string         `gorm:"type:varchar(30);not null"`
	WeChat   sql.NullString `gorm:"type:varchar(50);"`
	Email    sql.NullString `gorm:"type:varchar(50);"`
	Location string         `gorm:"type:varchar(200);not null"`

	BuyPrice modeltype.Price `gorm:"type:uint;not null"`
	BuyTotal modeltype.Total `gorm:"type:uint;not null"`

	BuyDaoHuo  modeltype.Total `gorm:"type:uint;not null"`
	BuyPingjia modeltype.Total `gorm:"type:uint;not null"`
	BuyGood    modeltype.Total `gorm:"type:uint;not null"`
	BuyJian    modeltype.Total `gorm:"type:uint;not null"`

	Hot       bool `gorm:"type:boolean;not null;"`
	WupinDown bool `gorm:"type:boolean;not null;"`
	ClassShow bool `gorm:"type:boolean;not null;"`
	ClassDown bool `gorm:"type:boolean;not null;"`
}

func (*WupinM) TableName

func (*WupinM) TableName() string

type Xieyi

type Xieyi struct {
	gorm.Model
	Type modeltype.XieYiType `gorm:"type:VARCHAR(20);not null"`
	Data string              `gorm:"type:TEXT;not null"`
}

func NewXieyi

func NewXieyi(xieyiType modeltype.XieYiType, content string) *Xieyi

func (*Xieyi) TableName

func (*Xieyi) TableName() string

type XieyiM

type XieyiM struct {
	gorm.Model
	Type modeltype.XieYiType `gorm:"type:VARCHAR(20);not null"`
	Data string              `gorm:"type:TEXT;not null"`
}

func (*XieyiM) TableName

func (*XieyiM) TableName() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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