示例#1
0
 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)));
 }
示例#2
0
 public Task <BodyResponse <NullBody> > PushMsg(long id, UserMsgInfo msg)
 {
     return(_bus.SendCommand(new PushMsgCommand(id, msg)));
 }
示例#3
0
 public Task SetMsgInfo(long id, MsgTypes msgType, UserMsgInfo info)
 {
     return(_redis.AddHashValueAsync(KeyGenHelper.GenUserKey(id, "Msgs", msgType.ToString()), info.MsgId, info));
 }
示例#4
0
 public PushMsgCommand(long id, UserMsgInfo msg)
 {
     Id  = id;
     Msg = msg;
 }