Exemple #1
0
        public Task ErrorEvent(HttpContext context)
        {
            var feature = context.Features.Get <IExceptionHandlerFeature>();
            var error   = feature?.Error;

            SentryLog.Log(error);
            return(context.Response.WriteAsync("发生错误,已上报,请等待处理。"));
        }
Exemple #2
0
        public async Task <IActionResult> notify(payapiNotifyModel model)
        {
            try
            {
                DateTime?endTime = null;
                switch (model.price)
                {
                case 0.01:
                case 30.00:
                    endTime = DateTime.Now.AddDays(30);
                    break;

                case 85.00:
                    endTime = DateTime.Now.AddMonths(3);
                    break;

                case 100:
                    endTime = DateTime.Now.AddMonths(6);
                    break;

                case 180:
                    endTime = DateTime.Now.AddYears(1);
                    break;

                default:
                    endTime = null;
                    break;
                }

                var jsonStr = Newtonsoft.Json.JsonConvert.SerializeObject(model);
                SentryLog.Log(jsonStr);
                var orderId    = Guid.Parse(model.orderid);
                var orderModel = userAccountBisness.userAccountAccessor.All <PayAPILog>().FirstOrDefault(x => x.Id == orderId);
                orderModel.Statue        = PayAPILogStatus.End;
                orderModel.PayAPIOrderId = model.paysapi_id;
                orderModel.EndTime       = endTime;

                var userInfo = await userAccountBisness.userAccountAccessor.OneAsync <UserAccountEntry>(x => x.Id == orderModel.UserAccountId, "InviteOrigin");

                if (userInfo?.InviteOrigin?.InviteKey == "lnn")
                {
                    orderModel.EndTime = DateTime.Now.AddYears(1);
                }
                await userAccountBisness.userAccountAccessor.SaveAsync();
            }
            catch (Exception exc)
            {
                SentryLog.Log(exc);
            }
            return(Content("success"));
        }
Exemple #3
0
        public async Task OnGet()
        {
            await HttpContext.Session.LoadAsync();

            var userId = HttpContext.Session.GetString(UserAccountBusiness.UserAccountSessionkey);

            UserId = userId;
            SentryLog.Log("test lottery userId;" + userId);
            //userId = "d14e4c49-5502-43df-8ce9-0bf93baef067";
            var _userId = Guid.Parse(userId);

            UserInfo = await userAccountBusiness.GetUserInfo(_userId);

            HasPlay = await activityBusiness.HasPlay(ActivityNamek, _userId);
        }
Exemple #4
0
 public void OnGet()
 {
     RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier;
     SentryLog.Log(HttpContext.Features.Get <IExceptionHandlerFeature>().Error.Message);
 }
Exemple #5
0
 public async Task <IActionResult> WeiboLogout(string code)
 {
     SentryLog.Log("记录 微博取消登录 回调值:" + code);
     return(Content(code));
 }