Example #1
0
        public async Task <ResponseMessage <PeriodGift> > GetPeriodIdMemo(Models.UserInfo user, [FromRoute] string periodId)
        {
            Logger.Trace($"用户{user?.UserName ?? ""}({user?.Id ?? ""})赛季奖品管理-查询赛季奖品的说明,请求参数为:periodId{periodId}");
            var response = new ResponseMessage <PeriodGift>();

            if (string.IsNullOrWhiteSpace(periodId))
            {
                response.Code    = ResponseCodeDefines.ArgumentNullError;
                response.Message = "periodId不能为空";
                return(response);
            }
            try
            {
                response = await _giftManager.GetPeriodIdMemoAsync(user, periodId, HttpContext.RequestAborted);
            }
            catch (Exception e)
            {
                response.Code    = ResponseCodeDefines.ServiceError;
                response.Message = e.Message;
                Logger.Error($"用户{user?.UserName ?? ""}({user?.Id ?? ""})赛季奖品管理-查询赛季奖品的说明,报错:{e.Message}\r\n{e.StackTrace}");
            }
            return(response);
        }