entity

package
v0.0.0-...-0964d17 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPlantNotFound は植物が存在しないエラーを表します。
	ErrPlantNotFound = errors.New("plant not found")
	// ErrUserNotFound はユーザが存在しないエラーを表します。
	ErrUserNotFound = errors.New("user not found")
	// ErrCultivationNotFound は栽培物が存在しないエラーを表します。
	ErrCultivationNotFound = errors.New("cultivation not found")

	ErrInvalidIdToken = errors.New("Invalid ID token")
)

Functions

This section is empty.

Types

type Cultivation

type Cultivation struct {
	ID                  int `gorm:"primary_key"`
	CreatedAt           time.Time
	UpdatedAt           time.Time
	DeletedAt           *time.Time `sql:"index"`
	UserID              int
	User                User `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	PlantID             int
	Plant               Plant `gorm:"constraint:OnUpdate:CASCADE,OnDelete:RESTRICT;"`
	StartCultivatingAt  *time.Time
	FinishCultivatingAt *time.Time
	NickName            string
}

type Cultivations

type Cultivations []Cultivation

type Harvesting

type Harvesting struct {
	ID            int `gorm:"primary_key"`
	CreatedAt     time.Time
	UpdatedAt     time.Time
	DeletedAt     *time.Time `sql:"index"`
	CultivationID int
	Cultivation   Cultivation `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
}

type Harvestings

type Harvestings []Harvesting

type Id

type Id int

type Plant

type Plant struct {
	ID                int `gorm:"primary_key"`
	CreatedAt         time.Time
	UpdatedAt         time.Time
	DeletedAt         *time.Time `sql:"index"`
	Name              string
	NickName          string
	Price             int
	Period            int
	Difficulty        int
	Description       string
	KitName           string
	SeasonFrom        int
	SeasonTo          int
	PlantTemperatures []PlantTemperature
	PlantWaters       []PlantWater
}

type PlantTemperature

type PlantTemperature struct {
	ID        int `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time `sql:"index"`
	PlantID   int
	Plant     Plant `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	WaterID   int
	Water     Water `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	Threshold int
}

type PlantTemperatures

type PlantTemperatures []Temperature

type PlantWater

type PlantWater struct {
	ID        int `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time `sql:"index"`
	PlantID   int
	Plant     Plant `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	WaterID   int
	Water     Water `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
	Threshold int
}

type PlantWaters

type PlantWaters []Water

type Plants

type Plants []Plant

type Season

type Season struct {
	ID        int `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time `sql:"index"`
}

type Seasons

type Seasons []Season

type Temperature

type Temperature struct {
	ID        int `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time `sql:"index"`
	Name      string
}

type Temperatures

type Temperatures []Temperature

type User

type User struct {
	ID           int `gorm:"primary_key"`
	CreatedAt    time.Time
	UpdatedAt    time.Time
	DeletedAt    *time.Time `sql:"index"`
	Uid          string     `gorm:"unique"`
	Name         string
	Cultivations []Cultivation
}

type Users

type Users []User

type Water

type Water struct {
	ID        int `gorm:"primary_key"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt *time.Time `sql:"index"`
	Name      string
}

type Watering

type Watering struct {
	ID            int `gorm:"primary_key"`
	CreatedAt     time.Time
	UpdatedAt     time.Time
	DeletedAt     *time.Time `sql:"index"`
	CultivationID int
	Cultivation   Cultivation `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
}

type Waterings

type Waterings []Watering

type Waters

type Waters []Water

Jump to

Keyboard shortcuts

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