model

package
v0.0.0-...-36d6084 Latest Latest
Warning

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

Go to latest
Published: May 20, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DbEngine *xorm.Engine

Functions

func ActionName

func ActionName(action string) string

func GetEngine

func GetEngine() *xorm.Engine

func NewEngine

func NewEngine() *xorm.Engine

func NewTransactionLog

func NewTransactionLog(taskId, uid int64, transactionId, t_type string) error

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"`
}

func (*Account) TableName

func (a *Account) TableName() string

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 (u *User) GenMd5Passwd() error

func (*User) GenRandomUserName

func (u *User) GenRandomUserName()

func (*User) TableName

func (u *User) TableName() string

type UserInfo

type UserInfo struct {
	Id       int64  `json:"id" xorm:"pk"`
	Uid      int64  `json:"uid"`
	RealName string `json:"realname"`
}

func (*UserInfo) TableName

func (u *UserInfo) TableName() string

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
包含用户支付验证的验证字段

func (*Wallet) TableName

func (w *Wallet) TableName() string

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

Jump to

Keyboard shortcuts

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