public ApiResult CancelCollect(Guid goodsId) { if (goodsId.Equals(Guid.Empty)) { throw new WebApiInnerException("0001", "商品Id不合法"); } if (!_markupService.MarkupExist(goodsId, MallModule.Key, AuthorizedUser.Id, MarkupType.Collect)) { throw new WebApiInnerException("0002", "还没有收藏"); } _markupService.CancelMarkup(goodsId, MallModule.Key, AuthorizedUser.Id, MarkupType.Collect); return(new ApiResult()); }
public ApiResult CreateBrowse(Guid goodsId) { if (goodsId.Equals(Guid.Empty)) { throw new WebApiInnerException("0001", "商品Id不合法"); } if (_markupService.MarkupExist(goodsId, MallModule.Key, AuthorizedUser.Id, MarkupType.Browse)) { _markupService.CancelMarkup(goodsId, MallModule.Key, AuthorizedUser.Id, MarkupType.Browse); } _markupService.CreateMarkup(goodsId, MallModule.Key, AuthorizedUser.Id, MarkupType.Browse); return(new ApiResult()); }