This commit is contained in:
2026-06-19 10:56:52 +08:00
parent d71a23fa57
commit 2dcba2e5d9
10 changed files with 310 additions and 80 deletions

View File

@@ -150,3 +150,17 @@ func (r *GormQueryWhitelistRepository) ExistsByUserIDCardHashAndName(
}
return count > 0, nil
}
func (r *GormQueryWhitelistRepository) FindByUserIDCardHashAndName(
ctx context.Context,
userID, idCardHash, name string,
) (*entities.QueryWhitelistEntry, error) {
var entry entities.QueryWhitelistEntry
err := r.GetDB(ctx).
Where("user_id = ? AND id_card_hash = ? AND name = ?", userID, idCardHash, name).
First(&entry).Error
if err != nil {
return nil, err
}
return &entry, nil
}