Documentation
¶
Index ¶
- Variables
- type Bag
- type BagM
- type BuyRecord
- func (r *BuyRecord) AcceptQuXiao() bool
- func (r *BuyRecord) AcceptTuiHuo() bool
- func (r *BuyRecord) BindUser(u *User)
- func (r *BuyRecord) ChangeShop(shopname, shopphone, shoplocation, shopwechat, shopemail, shopremark string) bool
- func (r *BuyRecord) ChangeUser(username, userphone, userlocation, userwechat, useremail, userremark string) bool
- func (r *BuyRecord) CheHuiFaHuo() bool
- func (r *BuyRecord) DaoHuo() bool
- func (r *BuyRecord) FaHuoDengJi(kuaidi string, kuaidinum string) bool
- func (r *BuyRecord) GetBagPayUrl(pft modeltype.PayFromType, redirect string) string
- func (r *BuyRecord) GetNewPayUrl(pft modeltype.PayFromType, redirect string) string
- func (r *BuyRecord) GetRepayPayUrl(pft modeltype.PayFromType, redirect string) string
- func (r *BuyRecord) IsBuyRecordCanNotPay() bool
- func (r *BuyRecord) IsBuyRecordCanNotRepay() bool
- func (r *BuyRecord) IsBuyRecordCanPay() bool
- func (r *BuyRecord) IsBuyRecordCanRepay() bool
- func (*BuyRecord) IsBuyRecordDown() bool
- func (r *BuyRecord) IsWupinNotSale() bool
- func (r *BuyRecord) IsWupinSale() bool
- func (r *BuyRecord) NotAcceptTuiHuo() bool
- func (r *BuyRecord) NotQuXiaoFaHuo() bool
- func (r *BuyRecord) PayFail() bool
- func (r *BuyRecord) PaySuccess() bool
- func (r *BuyRecord) PingJia(isGood bool) bool
- func (r *BuyRecord) QuXiaoFaHuo() bool
- func (r *BuyRecord) QuXiaoPay() bool
- func (r *BuyRecord) Repay()
- func (r *BuyRecord) TuiHuoDaoHuo() bool
- func (r *BuyRecord) TuiHuoDengJi(kuaidi string, kuaidinum string) bool
- func (r *BuyRecord) TuiHuoShenQing() bool
- type BuyRecordM
- type Class
- type ClassM
- type Config
- type ConfigM
- type Image
- type ImageM
- type Msg
- type MsgM
- type User
- func (u *User) BuyNow(r *BuyRecord) bool
- func (u *User) BuyQuXiao(r *BuyRecord) bool
- func (u *User) CanLogin() bool
- func (u *User) Daohuo() bool
- func (u *User) GetLongName() string
- func (u *User) HasPermission(admin *User) bool
- func (u *User) IsAdmin() bool
- func (u *User) IsDeleteUser() bool
- func (u *User) IsNormalAdmin() bool
- func (u *User) IsNormalUser() bool
- func (u *User) IsRootAdmin() bool
- func (u *User) PasswordCheck(password string) bool
- func (u *User) PingJia(isGood bool) bool
- func (u *User) SetNewPassword(password string) bool
- func (*User) TableName() string
- func (u *User) TuiHuoAfterFaHuo(r *BuyRecord) bool
- func (u *User) TuiHuoBeforeFaHuo(r *BuyRecord) bool
- func (u *User) UpdateAvatar(avatarUrl string) bool
- func (u *User) UpdateInfo(name string, wechat string, email string, location string)
- func (u *User) UpdatePassword(newPassword string)
- func (u *User) UpdatePasswordWithCheck(oldPassword string, newPassword string) bool
- func (u *User) UpdatePhone(phone string)
- func (u *User) UpdateStatus(st modeltype.UserStatus) bool
- func (u *User) UpdateStatusWithRoot(st modeltype.UserStatus) bool
- func (u *User) UpdateType(tp modeltype.UserType) bool
- type UserM
- type Video
- type VideoM
- type Wupin
- func (w *Wupin) BuyNow(r *BuyRecord) bool
- func (w *Wupin) BuyQuXiao(r *BuyRecord) bool
- func (w *Wupin) Daohuo() bool
- func (w *Wupin) GetFacePrice() modeltype.Price
- func (w *Wupin) GetPrice() modeltype.Price
- func (w *Wupin) GetPriceTotal(num modeltype.Total) modeltype.Price
- func (w *Wupin) GetRealPrice() modeltype.Price
- func (w *Wupin) IsWupinCanNotSale() bool
- func (w *Wupin) IsWupinCanSale() bool
- func (w *Wupin) IsWupinDown() bool
- func (m *Wupin) IsWupinHot() bool
- func (m *Wupin) IsWupinShow() bool
- func (w *Wupin) PingJia(isGood bool) bool
- func (*Wupin) TableName() string
- func (w *Wupin) TuiHuoAfterFaHuo(r *BuyRecord) bool
- func (w *Wupin) TuiHuoBeforeFaHuo(r *BuyRecord) bool
- func (w *Wupin) UpdateInfo(name string, pic string, class *Class, tag string, ...) bool
- func (w *Wupin) UpdateNormalInfo(name string, pic string, class *Class, tag string, ...) bool
- func (w *Wupin) UpdateShopInfo(ren string, phone string, email string, wechat string, location string) bool
- type WupinM
- type Xieyi
- type XieyiM
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 (*Bag) IsBagCanNotSale ¶
func (*Bag) IsBagCanSale ¶
func (*Bag) IsBagNotShow ¶
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;"` }
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 NewBuyRecord ¶
func (*BuyRecord) AcceptQuXiao ¶
func (*BuyRecord) AcceptTuiHuo ¶
func (*BuyRecord) ChangeShop ¶
func (*BuyRecord) ChangeUser ¶
func (*BuyRecord) CheHuiFaHuo ¶
func (*BuyRecord) FaHuoDengJi ¶
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 (*BuyRecord) IsBuyRecordCanNotRepay ¶
func (*BuyRecord) IsBuyRecordCanPay ¶
func (*BuyRecord) IsBuyRecordCanRepay ¶
func (*BuyRecord) IsBuyRecordDown ¶
func (*BuyRecord) IsWupinNotSale ¶
func (*BuyRecord) IsWupinSale ¶
func (*BuyRecord) NotAcceptTuiHuo ¶
func (*BuyRecord) NotQuXiaoFaHuo ¶
func (*BuyRecord) PaySuccess ¶
func (*BuyRecord) QuXiaoFaHuo ¶
func (*BuyRecord) TuiHuoDaoHuo ¶
func (*BuyRecord) TuiHuoDengJi ¶
func (*BuyRecord) TuiHuoShenQing ¶
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 NewEmptyClass ¶
func NewEmptyClass() *Class
func (*Class) IsClassDown ¶
func (*Class) IsClassDownOrNotShow ¶
func (*Class) IsClassShow ¶
func (*Class) ResetIsEmpty ¶
type ClassM ¶
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 NewConfig ¶
func NewConfig(Key modeltype.ConfigKeyType, Value modeltype.ConfigValueType) *Config
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"` }
type Image ¶
type ImageM ¶
type Msg ¶
type MsgM ¶
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 (*User) GetLongName ¶
func (*User) HasPermission ¶
func (*User) IsDeleteUser ¶
func (*User) IsNormalAdmin ¶
func (*User) IsNormalUser ¶
func (*User) IsRootAdmin ¶
func (*User) PasswordCheck ¶
func (*User) SetNewPassword ¶
func (*User) TuiHuoAfterFaHuo ¶
func (*User) TuiHuoBeforeFaHuo ¶
func (*User) UpdateAvatar ¶
func (*User) UpdateInfo ¶
func (*User) UpdatePassword ¶
func (*User) UpdatePasswordWithCheck ¶
func (*User) UpdatePhone ¶
func (*User) UpdateStatus ¶
func (u *User) UpdateStatus(st modeltype.UserStatus) bool
func (*User) UpdateStatusWithRoot ¶
func (u *User) UpdateStatusWithRoot(st modeltype.UserStatus) 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"` }
type Video ¶
type VideoM ¶
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 (*Wupin) GetFacePrice ¶
func (*Wupin) GetRealPrice ¶
func (*Wupin) IsWupinCanNotSale ¶
func (*Wupin) IsWupinCanSale ¶
func (*Wupin) IsWupinDown ¶
func (*Wupin) IsWupinHot ¶
func (*Wupin) IsWupinShow ¶
func (*Wupin) TuiHuoAfterFaHuo ¶
func (*Wupin) TuiHuoBeforeFaHuo ¶
func (*Wupin) UpdateInfo ¶
func (*Wupin) UpdateNormalInfo ¶
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;"` }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.