/// <summary> /// 添加收藏 /// </summary> /// <param name="objectId">被收藏对象Id</param> /// <param name="userId">用户Id</param> /// <returns>true-收藏成功,false-收藏失败</returns> public bool Favorite(long objectId, long userId) { EventBus <long, FavoriteEventArgs> .Instance().OnBefore(objectId, new FavoriteEventArgs(EventOperationType.Instance().Create(), tenantTypeId, userId)); bool result = favoriteRepository.Favorite(objectId, userId, tenantTypeId); EventBus <long, FavoriteEventArgs> .Instance().OnAfter(objectId, new FavoriteEventArgs(EventOperationType.Instance().Create(), tenantTypeId, userId)); return(result); }