mirror of
https://github.com/SamyRai/tercul-backend.git
synced 2025-12-27 00:31:35 +00:00
35 lines
1.0 KiB
Go
35 lines
1.0 KiB
Go
package models
|
|
|
|
// Emotion represents an emotion associated with a work
|
|
type Emotion struct {
|
|
BaseModel
|
|
Name string `gorm:"size:100;not null"`
|
|
Description string `gorm:"type:text"`
|
|
Language string `gorm:"size:50;not null"`
|
|
Intensity float64 `gorm:"type:decimal(5,2);default:0.0"`
|
|
UserID *uint
|
|
User *User `gorm:"foreignKey:UserID"`
|
|
WorkID *uint
|
|
Work *Work `gorm:"foreignKey:WorkID"`
|
|
CollectionID *uint
|
|
Collection *Collection `gorm:"foreignKey:CollectionID"`
|
|
}
|
|
|
|
// Mood represents a mood associated with a work
|
|
type Mood struct {
|
|
BaseModel
|
|
Name string `gorm:"size:100;not null"`
|
|
Description string `gorm:"type:text"`
|
|
Language string `gorm:"size:50;not null"`
|
|
Works []*Work `gorm:"many2many:work_moods"`
|
|
}
|
|
|
|
// TopicCluster represents a cluster of related topics
|
|
type TopicCluster struct {
|
|
BaseModel
|
|
Name string `gorm:"size:100;not null"`
|
|
Description string `gorm:"type:text"`
|
|
Keywords string `gorm:"type:text"`
|
|
Works []*Work `gorm:"many2many:work_topic_clusters"`
|
|
}
|