Exemplo n.º 1
0
        /// <summary>
        /// 取消收藏
        /// </summary>
        /// <param name="userId">用户Id</param>
        /// <param name="objectId">被收藏对象Id</param>
        /// <returns>true-取消成功,false-取消失败</returns>
        public bool CancelFavorite(long objectId, long userId)
        {
            EventBus <long, FavoriteEventArgs> .Instance().OnBefore(objectId, new FavoriteEventArgs(EventOperationType.Instance().Create(), tenantTypeId, userId));

            bool result = favoriteRepository.CancelFavorited(objectId, userId, tenantTypeId);

            EventBus <long, FavoriteEventArgs> .Instance().OnAfter(objectId, new FavoriteEventArgs(EventOperationType.Instance().Create(), tenantTypeId, userId));

            return(result);
        }