fix: update admin flows and review report
This commit is contained in:
@@ -33,6 +33,11 @@ func (r *UserRoleRepository) DeleteByUserID(ctx context.Context, userID int64) e
|
||||
return r.db.WithContext(ctx).Where("user_id = ?", userID).Delete(&domain.UserRole{}).Error
|
||||
}
|
||||
|
||||
// DeleteByUserAndRole 删除指定用户和角色的关联
|
||||
func (r *UserRoleRepository) DeleteByUserAndRole(ctx context.Context, userID, roleID int64) error {
|
||||
return r.db.WithContext(ctx).Where("user_id = ? AND role_id = ?", userID, roleID).Delete(&domain.UserRole{}).Error
|
||||
}
|
||||
|
||||
// DeleteByRoleID 删除角色的所有用户
|
||||
func (r *UserRoleRepository) DeleteByRoleID(ctx context.Context, roleID int64) error {
|
||||
return r.db.WithContext(ctx).Where("role_id = ?", roleID).Delete(&domain.UserRole{}).Error
|
||||
|
||||
Reference in New Issue
Block a user