You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

36 lines
974 B

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:"-"`
}
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"`
}