mirror of
https://github.com/SamyRai/tercul-backend.git
synced 2025-12-27 05:11:34 +00:00
- Core Go application with GraphQL API using gqlgen - Comprehensive data models for literary works, authors, translations - Repository pattern with caching layer - Authentication and authorization system - Linguistics analysis capabilities with multiple adapters - Vector search integration with Weaviate - Docker containerization support - Python data migration and analysis scripts - Clean architecture with proper separation of concerns - Production-ready configuration and middleware - Proper .gitignore excluding vendor/, database files, and build artifacts
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"`
|
|
}
|