models

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppPassword added in v0.2.0

type AppPassword struct {
	ID          uuid.UUID      `gorm:"primaryKey;type:uuid" json:"id,omitempty"`
	Description string         `json:"description,omitempty"`
	Secret      string         `json:"secret,omitempty"`
	UserID      uint           `gorm:"index" json:"user_id,omitempty"`
	User        *User          `gorm:"foreignKey:UserID" json:"user,omitempty"`
	LastUsedAt  time.Time      `json:"last_used_at,omitempty"`
	CreatedAt   time.Time      `json:"created_at,omitempty"`
	UpdatedAt   time.Time      `json:"updated_at,omitempty"`
	DeletedAt   gorm.DeletedAt `gorm:"index" json:"deleted_at,omitempty"`
}

func (*AppPassword) BeforeCreate added in v0.2.0

func (ap *AppPassword) BeforeCreate(scope *gorm.DB) error

type Hobbit

type Hobbit struct {
	ID          uint            `gorm:"primaryKey,autoIncrement" json:"id"`
	UserID      uint            `json:"-"`
	User        User            `gorm:"foreignKey:UserID" json:"user,omitempty"`
	Name        string          `json:"name,omitempty"`
	Image       string          `json:"image,omitempty"`
	Description string          `json:"description,omitempty"`
	Records     []NumericRecord `gorm:"foreignKey:HobbitID" json:"records,omitempty"`
	CreatedAt   time.Time
	UpdatedAt   time.Time
}

type NumericRecord

type NumericRecord struct {
	ID        uint      `gorm:"primaryKey,autoIncrement" json:"id"`
	Timestamp time.Time `gorm:"autoCreateTime" json:"timestamp"`
	HobbitID  uint      `json:"hobbit_id,omitempty"`
	Hobbit    Hobbit    `gorm:"foreignKey:HobbitID" json:"hobbit,omitempty"`
	Value     int64     `json:"value,omitempty"`
	Comment   string    `json:"comment,omitempty"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

type User

type User struct {
	ID       uint    `gorm:"primaryKey,autoIncrement" json:"id,omitempty"`
	Username string  `json:"username,omitempty"`
	Secret   string  `json:"-"`
	Image    string  `json:"image,omitempty"`
	Follows  []*User `json:"-" gorm:"many2many:user_follows;"`
}

Jump to

Keyboard shortcuts

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