public Task AddMsgInfo(long id, MsgTypes msgType, UserMsgInfo info) { return(Task.WhenAll(_redis.AddZsetValueAsync(KeyGenHelper.GenUserKey(id, "MsgIds", msgType.ToString()), info.MsgId, DateTime.Now.ToTimeStamp(), TimeSpan.FromDays(30)), _redis.AddHashValueAsync(KeyGenHelper.GenUserKey(id, "Msgs", msgType.ToString()), info.MsgId, info, TimeSpan.FromDays(30)), DeleteExpiredMsgs(id, msgType))); }
public Task <BodyResponse <NullBody> > PushMsg(long id, UserMsgInfo msg) { return(_bus.SendCommand(new PushMsgCommand(id, msg))); }
public Task SetMsgInfo(long id, MsgTypes msgType, UserMsgInfo info) { return(_redis.AddHashValueAsync(KeyGenHelper.GenUserKey(id, "Msgs", msgType.ToString()), info.MsgId, info)); }
public PushMsgCommand(long id, UserMsgInfo msg) { Id = id; Msg = msg; }