dummy

package
v0.0.0-...-9c2da45 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDummyAdmin

func NewDummyAdmin(keepData ...bool) *admin.Admin

NewDummyAdmin generate admin for dummy app

Types

type Address

type Address struct {
	gorm.Model
	UserID   uint
	Address1 string
	Address2 string
}

type Company

type Company struct {
	gorm.Model
	Name string
}

type CreditCard

type CreditCard struct {
	gorm.Model
	Number string
	Issuer string
}

type Language

type Language struct {
	gorm.Model
	Name string
}

type Phone

type Phone struct {
	gorm.Model

	ProfileID uint64
	Num       string
}

type Profile

type Profile struct {
	gorm.Model
	UserID uint
	Name   string
	Sex    string

	Phone Phone
}

type User

type User struct {
	gorm.Model
	Name         string
	Age          uint
	Role         string
	Active       bool
	RegisteredAt *time.Time
	Avatar       oss.OSS
	Profile      Profile // has one
	CreditCardID uint
	CreditCard   CreditCard // belongs to
	Addresses    []Address  // has many
	CompanyID    uint
	Company      *Company   // belongs to
	Languages    []Language `gorm:"many2many:user_languages;"` // many 2 many
}

Jump to

Keyboard shortcuts

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