models

package
v0.0.0-...-c29577a Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Person

type Person struct {
	ID int `gorm:"primary_key" json:"id"`

	Name    string `gorm:"column:name;type:TEXT;NOT NULL" json:"name"`
	Surname string `gorm:"column:surname;type:TEXT;NOT NULL" json:"surname"`

	Patronymic null.String `gorm:"column:patronymic;type:TEXT" json:"patronymic,omitempty"`
	Age        null.Int    `gorm:"column:age;type:INT" json:"age,omitempty"`

	GenderID *int         `json:"-"`
	Gender   PersonGender `gorm:"foreignKey:GenderID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE" json:"gender,omitempty"`

	Country []PersonCountry `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE" json:"country,omitempty"`
}

func (*Person) MergeWithPatchRequest

func (p *Person) MergeWithPatchRequest(req *requests.PatchPersonRequest)

func (*Person) TableName

func (p *Person) TableName() string

type PersonCountry

type PersonCountry struct {
	ID int `gorm:"primary_key" json:"id"`

	PersonID int `json:"-"`

	CountryID   string  `gorm:"column:country_id;type:TEXT;NOT NULL" json:"country_id"`
	Probability float32 `gorm:"column:probability;type:FLOAT;NOT NULL" json:"probability"`
}

func (*PersonCountry) TableName

func (p *PersonCountry) TableName() string

type PersonGender

type PersonGender struct {
	ID int `gorm:"primary_key" json:"id"`

	Gender      string  `gorm:"column:gender;type:TEXT;NOT NULL" json:"gender"`
	Probability float32 `gorm:"column:probability;type:FLOAT;NOT NULL" json:"probability"`
}

func (*PersonGender) TableName

func (p *PersonGender) TableName() string

Jump to

Keyboard shortcuts

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