demo

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 8, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DbComponent mysql.Component

Functions

func Test1

func Test1(log gsf.LoggerInterface) error

func Test2

func Test2(log gsf.LoggerInterface) error

func Test3

func Test3(log gsf.LoggerInterface) error

Types

type Profile

type Profile struct {
	ID      uint `gorm:"primaryKey"`
	Phone   string
	Address string
}

type Test1User

type Test1User struct {
	ID uint `gorm:"primaryKey"`
}

func (*Test1User) TableName

func (*Test1User) TableName() string

type Test1UserAll

type Test1UserAll struct {
	Test1UserName `gorm:"embedded"`
	Age           int
	Education     Test1UserEducation `gorm:"TYPE:json"`
	Power         Test1UserPowers    `gorm:"TYPE:string"`
}

func (*Test1UserAll) AfterFind

func (u *Test1UserAll) AfterFind(tx *gorm.DB) (err error)

type Test1UserEducation

type Test1UserEducation struct {
	School string `json:"school"`
}

func (*Test1UserEducation) Scan

func (v *Test1UserEducation) Scan(value interface{}) error

type Test1UserName

type Test1UserName struct {
	Test1User `gorm:"embedded"`
	Name      string
}

type Test1UserPower

type Test1UserPower struct {
	Id, Name string
}

type Test1UserPowers

type Test1UserPowers []Test1UserPower

func (*Test1UserPowers) Scan

func (v *Test1UserPowers) Scan(value interface{}) error

type Test2Book

type Test2Book struct {
	ID     uint `gorm:"primaryKey"`
	UserId uint
	Name   string
	IsDel  uint8
}

func (*Test2Book) TableName

func (*Test2Book) TableName() string

type Test2User

type Test2User struct {
	ID   uint `gorm:"primaryKey"`
	Name string
	Age  int
}

func (*Test2User) TableName

func (*Test2User) TableName() string

type Test2UserBook

type Test2UserBook struct {
	Test2User `gorm:"embedded"`
	Books     []Test2Book `gorm:"foreignkey:UserId;references:ID"`
}

type Test2UserProfile

type Test2UserProfile struct {
	ID      int
	Age     int
	Name    string
	Phone   string
	Address string
}

func (Test2UserProfile) MarshalJSON

func (t Test2UserProfile) MarshalJSON() ([]byte, error)

type Test3User

type Test3User struct {
	ID   uint `gorm:"primaryKey"`
	Name string
	Age  int
}

Jump to

Keyboard shortcuts

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