Exemplo n.º 1
0
        public override async Task DeleteAsync(Guid id)
        {
            await CheckDeletePolicyAsync();

            var coupon = await GetEntityByIdAsync(id);

            var couponTemplate = await _couponTemplateRepository.GetAsync(coupon.CouponTemplateId);

            await AuthorizationService.CheckMultiStorePolicyAsync(couponTemplate.StoreId,
                                                                  CouponsPermissions.Coupon.Manage, CouponsPermissions.Coupon.CrossStore);

            await _repository.DeleteAsync(coupon, true);
        }
Exemplo n.º 2
0
        public async Task <ApiRequestResult> DeleteAsync([FromRoute] Guid id)
        {
            await _couponRepository.DeleteAsync(id);

            return(ApiRequestResult.Success("删除成功"));
        }