models

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contact

type Contact struct {
	Entity
	OrgType          types.OrgType     `gorm:"type:integer;not null" form:"gkvOrgType"`
	Name             string            `gorm:"type:varchar(100);not null" form:"gkvName"`
	NameExt          string            `gorm:"type:varchar(100)" form:"gkvNameExt"`
	ContactType      types.ContactType `gorm:"type:integer;not null" form:"gkvContactType"`
	ContactAddresses []ContactAddress
}

Contact ...

func (*Contact) BuildEntityOption

func (c *Contact) BuildEntityOption() dtos.EntityOption

BuildEntityOption ...

func (*Contact) LoadRelated

func (c *Contact) LoadRelated(db *gorm.DB) error

LoadRelated load related entities (implements EntityHolder)

type ContactAddress

type ContactAddress struct {
	Entity
	ContactID uint
	Street    string `gorm:"type:varchar(100);not null"`
	StreetNr  string `gorm:"type:varchar(10);not null"`
	StreetExt string `gorm:"type:varchar(50)"`
	Zip       string `gorm:"type:varchar(10);not null"`
	City      string `gorm:"type:varchar(100);not null"`
}

ContactAddress ...

type Entity

type Entity struct {
	gorm.Model
}

Entity ...

func (*Entity) BuildEntityOption

func (e *Entity) BuildEntityOption() dtos.EntityOption

BuildEntityOption ...

func (*Entity) LoadRelatedEntities

func (e *Entity) LoadRelatedEntities(db *gorm.DB) error

LoadRelatedEntities implement this method in concrete entity

type EntityFactory

type EntityFactory struct {
}

EntityFactory create Entities by name

func (EntityFactory) Get

func (ef EntityFactory) Get(entityName string) (interface{}, error)

Get return entity struct by name

func (EntityFactory) GetSlice

func (ef EntityFactory) GetSlice(entityName string) (interface{}, error)

GetSlice return slice of entity struct by name

type EntityHolder

type EntityHolder interface {
	LoadRelated(db *gorm.DB) error
}

EntityHolder struct that holds entities

type User

type User struct {
	Entity
	Name  string         `gorm:"type:varchar(50);not null;unique" form:"gkvName"`
	Pass  string         `gorm:"type:text;not null" form:"gkvPass"`
	Email string         `gorm:"type:varchar(100);not null" form:"gkvEmail"`
	Role  types.RoleType `gorm:"type:integer;not null" form:"gkvRole"`
}

User ...

func (*User) BuildEntityOption

func (u *User) BuildEntityOption() dtos.EntityOption

BuildEntityOption ...

Jump to

Keyboard shortcuts

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