public void TryHandleEvent(FootChatUnpaidEvent @event) { var uid = @event.Content.uid; //0:半小时未支付 1:1天未支付 var type = @event.Content.type; var firstIsPayFail = false; try { var serviceEvent = _ServiceEventFactory.CreateEvent(); switch (type) { case 0: serviceEvent.PayFail(uid, out firstIsPayFail); break; case 1: serviceEvent.PayFailAfterOneDay(uid); break; } } catch (System.Exception e) { Tgnet.Log.LoggerResolver.Current.Debug(string.Format("用户未支付消息推送失败!uid is {0} type is {1}", uid, type)); Tgnet.Log.LoggerResolver.Current.Fail(e); } finally { if (type == 0 && firstIsPayFail) { SendFootChatUnpaidEvent(1, uid, DateTime.Now.AddDays(1)); } } }
public void SendFootChatUnpaidEvent(byte type, long uid, DateTime?delay = null) { var newEvent = new FootChatUnpaidEvent { Delay = delay, Priority = 8, Content = new FootChatUnpaidContent { type = type, uid = uid } }; new Tgnet.Aliyun.MNS.EventService().Post(newEvent); }