예제 #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);
        }
예제 #2
0
        public async Task <ApiRequestResult> DeleteAsync([FromRoute] Guid id)
        {
            await _couponRepository.DeleteAsync(id);

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