|
|
- package models
-
- import "gorm.io/gorm"
-
- type PetCategory struct {
- gorm.Model `json:"-"`
- Id int `json:"id" gorm:"primary_key"`
- PetId int `json:"-"`
- Name string `json:"name"`
- }
-
- type PetTag struct {
- gorm.Model `json:"-"`
- Id int `json:"id" gorm:"primary_key"`
- PetId int `json:"-"`
- Name string `json:"name"`
- }
-
- type PetPhoto struct {
- gorm.Model `json:"-"`
- Id int `gorm:"primary_key"`
- PetId int `json:"-"`
- Url string `gorm:"-"`
- FileName string `json:"-"`
- AdditionalMetadata string `json:"-"`
- }
-
- type Pet struct {
- gorm.Model `json:"-"`
- Id int `json:"id" gorm:"primary_key"`
- Name string `json:"name"`
- Categories PetCategory `json:"category" gorm:"ForeignKey:PetId"`
- PhotoUrlJson []string `json:"photoUrls" gorm:"-"`
- PhotoUrls []PetPhoto `json:"-" gorm:"ForeignKey:PetId"`
- Tags []PetTag `json:"tags" gorm:"ForeignKey:PetId"`
- Status string `json:"status"`
- }
|