using Furion.FriendlyException; using GDZZ.Application.Entity; using GDZZ.Core; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace GDZZ.Application.Service { public class UtilService { private readonly SqlSugarRepository rechargeRep; //充值仓储 /// /// 奖励重载 /// /// public UtilService(SqlSugarRepository rechargeRep) { this.rechargeRep = rechargeRep; } /// /// 奖励 /// /// /// public async void Reward(long userID, decimal prize) { var recharge = await this.rechargeRep.InsertAsync(new MiniRecharge() { CreatedUserId = userID, PaymentMoney = prize, Status = RechargeEnum.Finish, Type = RechargeTypeEnum.Reward, TotalPrice = prize }); if (recharge < 1) throw Oops.Oh("奖励发放失败!"); } } }