public void HandleEvent(CreateMottoEvent @event) { var redis = _redisHelper.GetDatabase(); redis.HashIncrement(string.Format(KEY_USER_INFO_FMT, @event.Motto.UID), F_S_MOTTOS); redis.SetAdd(string.Format(KEY_USER_ALL_MOTTOS_FMT, @event.Motto.UID), @event.Motto.ID.ToString()); }
public void HandleEvent(CreateMottoEvent @event) { var theday = @event.Motto.AddTime.ToString("yyyyMMdd"); @event.Motto.Score = Utils.Hot(@event.Motto.Up, @event.Motto.Down, @event.Motto.AddTime); var entries = ConvertToHashEntries(@event.Motto); _redisHelper.HashSet(string.Format(KEY_EVAL_MOTTO_FMT, theday, @event.Motto.ID), entries, TimeSpan.FromDays(14)); _redisHelper.SortedSetAdd(string.Format(KEY_RANK_MOTTO_FMT, theday), @event.Motto.ID.ToString(), @event.Motto.Score); }