mirror of
https://github.com/SamyRai/tercul-backend.git
synced 2025-12-27 00:31:35 +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
41 lines
1.2 KiB
Go
41 lines
1.2 KiB
Go
package models
|
|
|
|
// Tag represents a tag for categorizing works
|
|
type Tag struct {
|
|
BaseModel
|
|
Name string `gorm:"size:100;not null;uniqueIndex"`
|
|
Description string `gorm:"type:text"`
|
|
Works []*Work `gorm:"many2many:work_tags"`
|
|
Slug string `gorm:"size:255;index"`
|
|
}
|
|
|
|
// Category represents a category for organizing works
|
|
type Category struct {
|
|
BaseModel
|
|
Name string `gorm:"size:100;not null;uniqueIndex"`
|
|
Description string `gorm:"type:text"`
|
|
ParentID *uint
|
|
Parent *Category `gorm:"foreignKey:ParentID"`
|
|
Children []*Category `gorm:"foreignKey:ParentID"`
|
|
Works []*Work `gorm:"many2many:work_categories"`
|
|
Path string `gorm:"size:1024;index"`
|
|
Slug string `gorm:"size:255;index"`
|
|
}
|
|
|
|
// Series represents a literary series
|
|
type Series struct {
|
|
BaseModel
|
|
Name string `gorm:"size:255;not null;uniqueIndex"`
|
|
Description string `gorm:"type:text"`
|
|
}
|
|
|
|
// WorkSeries is a join capturing a work's position in a series
|
|
type WorkSeries struct {
|
|
BaseModel
|
|
WorkID uint
|
|
Work *Work `gorm:"foreignKey:WorkID"`
|
|
SeriesID uint
|
|
Series *Series `gorm:"foreignKey:SeriesID"`
|
|
NumberInSeries int `gorm:"default:0"`
|
|
}
|