feat: Qdrant Vector Search support

Signed-off-by: Anush008 <anushshetty90@gmail.com>
This commit is contained in:
Anush008
2025-11-26 16:28:53 +05:30
committed by lyingbug
parent 3c3b457261
commit c7659c3d19
8 changed files with 725 additions and 58 deletions
+6 -6
View File
@@ -11,9 +11,9 @@ import (
)
var (
ErrUserNotFound = errors.New("user not found")
ErrUserNotFound = errors.New("user not found")
ErrUserAlreadyExists = errors.New("user already exists")
ErrTokenNotFound = errors.New("token not found")
ErrTokenNotFound = errors.New("token not found")
)
// userRepository implements user repository interface
@@ -82,15 +82,15 @@ func (r *userRepository) DeleteUser(ctx context.Context, id string) error {
func (r *userRepository) ListUsers(ctx context.Context, offset, limit int) ([]*types.User, error) {
var users []*types.User
query := r.db.WithContext(ctx).Order("created_at DESC")
if limit > 0 {
query = query.Limit(limit)
}
if offset > 0 {
query = query.Offset(offset)
}
if err := query.Find(&users).Error; err != nil {
return nil, err
}
@@ -151,4 +151,4 @@ func (r *authTokenRepository) DeleteExpiredTokens(ctx context.Context) error {
// RevokeTokensByUserID revokes all tokens for a user
func (r *authTokenRepository) RevokeTokensByUserID(ctx context.Context, userID string) error {
return r.db.WithContext(ctx).Model(&types.AuthToken{}).Where("user_id = ?", userID).Update("is_revoked", true).Error
}
}