model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountMgr

func AccountMgr(db *gorm.DB) *_AccountMgr

AccountMgr open func

func CloseRelated

func CloseRelated()

CloseRelated 关闭全局预加载

func OpenRelated

func OpenRelated()

OpenRelated 打开全局预加载

func UserMgr

func UserMgr(db *gorm.DB) *_UserMgr

UserMgr open func

Types

type Account

type Account struct {
	ID        int    `gorm:"primary_key;column:id;type:int;not null" json:"-"`
	AccountID int    `gorm:"unique_index:account;column:account_id;type:int" json:"account_id"`
	UserID    int    `gorm:"unique_index:account;index:tp;column:user_id;type:int" json:"user_id"`
	User      User   `gorm:"association_foreignkey:user_id;foreignkey:user_id" json:"user_list"`
	Type      int    `gorm:"index:tp;column:type;type:int" json:"type"`
	Name      string `gorm:"column:name;type:varchar(255)" json:"name"`
}

Account [...]

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option overrides behavior of Connect.

type User

type User struct {
	UserID int    `gorm:"primary_key;column:user_id;type:int;not null" json:"-"`
	Name   string `gorm:"column:name;type:varchar(30);not null" json:"name"`
	Sex    int    `gorm:"column:sex;type:int;not null" json:"sex"`
	Job    int    `gorm:"column:job;type:int;not null" json:"job"`
}

User [...]

Jump to

Keyboard shortcuts

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