Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DbEngine *xorm.Engine
Functions ¶
func ActionName ¶
func NewTransactionLog ¶
Types ¶
type Account ¶
type Account struct {
Id int64 `json:"id" xorm:"pk autoincr unique" `
Uid int64 `json:"uid"`
WalletId int64 `json:"wallet_id"`
Balance float64 `json:"balance"`
AccountName string `json:"account_name"`
Reputation int64 `json:"reputation"`
Status int `json:"status" xorm:"default 1"`
VerifyHash string `json:"verify_hash"`
Version int `xorm:"version"`
// ... Other information
CreatedAt time.Time `json:"created_at" xorm:"created"`
UpdatedAt time.Time `json:"updated_at" xorm:"updated"`
DeletedAt time.Time `json:"deleted_at" xorm:"deleted"`
}
type AccountLog ¶
type AccountLog struct {
Id int64 `json:"id" xorm:"pk autoincr unique" `
FromAccount string `json:"from_account"`
Action string `json:"action"`
ToAccount string `json:"to_account"`
Amount float64 `json:"amount"`
FreezeAmount float64 `json:"freeze_amount"`
Balance float64 `json:"balance"`
Status int `json:"status" xorm:"default 0"`
Memo string `json:"memo"`
TransactionId string `json:"transaction_id"`
// ... Other information
CreatedAt time.Time `json:"created_at" xorm:"created"`
UpdatedAt time.Time `json:"updated_at" xorm:"updated"`
}
func (*AccountLog) TableName ¶
func (t *AccountLog) TableName() string
type TransactionLog ¶
type TransactionLog struct {
Id int64 `json:"id" xorm:"pk autoincr unique"`
TaskId int64 `json:"task_id"`
TransactionId string `json:"transaction_id"`
Uid int64 `json:"uid"`
Type string `json:"type"`
//
CreatedAt time.Time `json:"created_at" xorm:"created"`
UpdatedAt time.Time `json:"updated_at" xorm:"updated"`
DeletedAt time.Time `json:"deleted_at" xorm:"deleted"`
}
func (*TransactionLog) TableName ¶
func (t *TransactionLog) TableName() string
type User ¶
type User struct {
Uid int64 `json:"uid" xorm:"pk"`
Username string `json:"username" xorm:"varchar(25) notnull unique 'username'"`
Passwd string `json:"passwd"`
Email string `json:"email"`
Phone string `json:"phone" xorm:"varchar(25) unique"`
Status int `json:"status" xorm:"default 1"` // 用户状态
LoginTime time.Time `json:"login_time" xorm:"<-"` // 最后登录时间
Passcode string `json:"passcode"` // 生成密码的随机数
UnionId string `json:"union_id"`
// ... Other information
CreatedAt time.Time `json:"created_at" xorm:"created"`
UpdatedAt time.Time `json:"updated_at" xorm:"updated"`
DeletedAt time.Time `json:"deleted_at" xorm:"deleted"`
}
func (*User) GenMd5Passwd ¶
func (*User) GenRandomUserName ¶
func (u *User) GenRandomUserName()
type UserInfo ¶
type Wallet ¶
type Wallet struct {
Id int64 `json:"id" xorm:"pk autoincr unique" `
Uid int64 `json:"uid"`
Name string `json:"name"`
Status int64 `json:"status"` // 0 locked; 1 unlocked
EncodeSecret string `json:"encode_secret"`
// ... Other information
CreatedAt time.Time `json:"created_at" xorm:"created"`
UpdatedAt time.Time `json:"updated_at" xorm:"updated"`
DeletedAt time.Time `json:"deleted_at" xorm:"deleted"`
}
*
逻辑上的wallet 包含用户支付验证的验证字段
type WechatUser ¶
type WechatUser struct {
Id int64 `json:"id" xorm:"pk autoincr unique" `
UnionId string `json:"union_id" xorm:"varchar(128) notnull unique"`
NickName string `json:"nick_name" xorm:"varchar(128)"`
Avatar string `json:"avatar" xorm:"varchar(128)"`
City string `json:"city"`
Province string `json:"province"`
Country string `json:"country"`
OpenId string `json:"open_id"`
Gender int `json:"gender"`
// ... Other information
CreatedAt time.Time `json:"created_at" xorm:"created"`
UpdatedAt time.Time `json:"updated_at" xorm:"updated"`
DeletedAt time.Time `json:"deleted_at" xorm:"deleted"`
}
func (*WechatUser) TableName ¶
func (w *WechatUser) TableName() string
Click to show internal directories.
Click to hide internal directories.