Files
gochat/internal/search/search_repo_interface.go
T

20 lines
1.1 KiB
Go

package search
import (
"context"
"github.com/gochat/gochat/internal/model"
)
// SearchRepoInterface defines the contract for search repository operations.
// This interface breaks the import cycle between search and repository packages.
// The concrete implementation is repository.SearchRepo, which satisfies this interface
// via adapter methods that accept *SearchFilter and convert to *RepoSearchFilter internally.
type SearchRepoInterface interface {
SearchConversations(ctx context.Context, accountID uint, query string, filter *SearchFilter) ([]model.Conversation, int64, error)
SearchMessages(ctx context.Context, accountID uint, query string, filter *SearchFilter) ([]model.Message, int64, error)
SearchContacts(ctx context.Context, accountID uint, query string, filter *SearchFilter) ([]model.Contact, int64, error)
SearchCompanies(ctx context.Context, accountID uint, query string, filter *SearchFilter) ([]model.Company, int64, error)
SearchArticles(ctx context.Context, accountID uint, query string, filter *SearchFilter) ([]model.Article, int64, error)
}