fadd
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user