mirror of
https://github.com/SamyRai/tercul-backend.git
synced 2025-12-27 05:11:34 +00:00
Some checks failed
- Updated database models and repositories to replace uint IDs with UUIDs. - Modified test fixtures to generate and use UUIDs for authors, translations, users, and works. - Adjusted mock implementations to align with the new UUID structure. - Ensured all relevant functions and methods are updated to handle UUIDs correctly. - Added necessary imports for UUID handling in various files.
59 lines
2.0 KiB
Go
59 lines
2.0 KiB
Go
package sql
|
|
|
|
import (
|
|
"tercul/internal/app/analytics"
|
|
"tercul/internal/domain"
|
|
"tercul/internal/platform/config"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type Repositories struct {
|
|
Work domain.WorkRepository
|
|
User domain.UserRepository
|
|
UserProfile domain.UserProfileRepository
|
|
Author domain.AuthorRepository
|
|
Translation domain.TranslationRepository
|
|
Comment domain.CommentRepository
|
|
Like domain.LikeRepository
|
|
Bookmark domain.BookmarkRepository
|
|
Collection domain.CollectionRepository
|
|
Tag domain.TagRepository
|
|
Category domain.CategoryRepository
|
|
Book domain.BookRepository
|
|
Publisher domain.PublisherRepository
|
|
Source domain.SourceRepository
|
|
Copyright domain.CopyrightRepository
|
|
Monetization domain.MonetizationRepository
|
|
Contribution domain.ContributionRepository
|
|
Analytics analytics.Repository
|
|
Auth domain.AuthRepository
|
|
Localization domain.LocalizationRepository
|
|
}
|
|
|
|
// NewRepositories creates a new Repositories container
|
|
func NewRepositories(db *gorm.DB, cfg *config.Config) *Repositories {
|
|
return &Repositories{
|
|
Work: NewWorkRepository(db, cfg),
|
|
User: NewUserRepository(db, cfg),
|
|
UserProfile: NewUserProfileRepository(db, cfg),
|
|
Author: NewAuthorRepository(db, cfg),
|
|
Translation: NewTranslationRepository(db, cfg),
|
|
Comment: NewCommentRepository(db, cfg),
|
|
Like: NewLikeRepository(db, cfg),
|
|
Bookmark: NewBookmarkRepository(db, cfg),
|
|
Collection: NewCollectionRepository(db, cfg),
|
|
Tag: NewTagRepository(db, cfg),
|
|
Category: NewCategoryRepository(db, cfg),
|
|
Book: NewBookRepository(db, cfg),
|
|
Publisher: NewPublisherRepository(db, cfg),
|
|
Source: NewSourceRepository(db, cfg),
|
|
Copyright: NewCopyrightRepository(db, cfg),
|
|
Monetization: NewMonetizationRepository(db, cfg),
|
|
Contribution: NewContributionRepository(db, cfg),
|
|
Analytics: NewAnalyticsRepository(db, cfg),
|
|
Auth: NewAuthRepository(db, cfg),
|
|
Localization: NewLocalizationRepository(db, cfg),
|
|
}
|
|
}
|