public bool GetLotteryData(string lotteryType, int?peroiod, out LotteryDataOutput lotteryDataOutput) { var lotteryData = _lotteryService.GetLotteryData(lotteryType, peroiod); if (lotteryData == null) { lotteryDataOutput = null; return(false); } lotteryDataOutput = Mapper.Map(lotteryData, new LotteryDataOutput()); return(true); }
public ResultMessage <LotteryDataOutput> GetLotteryData(string lotteryType, int?peroiod) { LotteryDataOutput lotteryData = null; var result = _lotteryDataAppService.GetLotteryData(lotteryType, peroiod, out lotteryData); if (result) { return(ResponseUtils.DataResult(lotteryData)); } string peroidStr = peroiod?.ToString() ?? "最后一期"; return(ResponseUtils.ErrorResult <LotteryDataOutput>($"获取{lotteryType}彩种第{peroidStr}期开奖数据失败,可能正在开奖...")); }