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); }
public async Task <ApiRequestResult> DeleteAsync([FromRoute] Guid id) { await _couponRepository.DeleteAsync(id); return(ApiRequestResult.Success("删除成功")); }