/// <summary> /// 已为视频投币个数是否小于2 /// </summary> /// <param name="aid">av号</param> /// <returns></returns> private bool IsDonatedLessThen2CoinsForVideo(string aid) { if (!_alreadyDonatedCoinCountCatch.TryGetValue(aid, out int multiply)) { multiply = _dailyTaskApi.GetDonatedCoinsForVideo(aid).Result.Data.Multiply; _alreadyDonatedCoinCountCatch.TryAdd(aid, multiply); } _logger.LogDebug("已为Av{aid}投过{num}枚硬币", aid, multiply); return(multiply < 2); }
/// <summary> /// 是否已为视频投币 /// </summary> /// <param name="aid">av号</param> /// <returns></returns> public bool IsDonatedCoinsForVideo(string aid) { int multiply = _dailyTaskApi.GetDonatedCoinsForVideo(aid).Result.Data.Multiply; if (multiply > 0) { //_logger.LogInformation("已经为Av" + aid + "投过" + multiply + "枚硬币啦"); return(true); } else { //_logger.LogInformation("还没有为Av" + aid + " 投过硬币,开始投币"); return(false); } }
/// <summary> /// 是否已为视频投币 /// </summary> /// <param name="aid">av号</param> /// <returns></returns> public bool CanDonatedCoinsForVideo(string aid) { int multiply = _dailyTaskApi.GetDonatedCoinsForVideo(aid).Result.Data.Multiply; if (multiply < 2) { _logger.LogDebug("已为Av" + aid + "投过" + multiply + "枚硬币,可以继续投币"); return(true); } else { _logger.LogDebug("已为Av" + aid + " 投过2枚硬币,不能再投币啦"); return(false); } }
/// <summary> /// 是否已为视频投币 /// </summary> /// <param name="aid">av号</param> /// <returns></returns> private bool CanDonatedCoinsForVideo(string aid) { if (!_alreadyDonatedCoinsCatch.TryGetValue(aid, out int multiply)) { multiply = _dailyTaskApi.GetDonatedCoinsForVideo(aid).Result.Data.Multiply; _alreadyDonatedCoinsCatch.TryAdd(aid, multiply); } if (multiply < 2) { _logger.LogDebug("已为Av{aid}投过{multiply}枚硬币,可以继续投币", aid, multiply); return(true); } else { _logger.LogDebug("已为Av{aid}投过2枚硬币,不能再投币啦", aid); return(false); } }