一阶段ok
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"mail_go/internal/db"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// Stores aggregates all store interfaces for convenient access.
|
||||
type Stores struct {
|
||||
Users UserStore
|
||||
Mails MailStore
|
||||
Domains DomainStore
|
||||
Attachments AttachmentStore
|
||||
}
|
||||
|
||||
// NewStores creates a new Stores instance with all GORM-backed implementations.
|
||||
func NewStores(database *gorm.DB) *Stores {
|
||||
return &Stores{
|
||||
Users: newUserStore(database),
|
||||
Mails: newMailStore(database),
|
||||
Domains: newDomainStore(database),
|
||||
Attachments: newAttachmentStore(database),
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure models are referenced (prevents unused import errors).
|
||||
var _ = db.User{}
|
||||
var _ = db.Domain{}
|
||||
var _ = db.Message{}
|
||||
var _ = db.Attachment{}
|
||||
Reference in New Issue
Block a user