//AddFollowersStatus add article to followers status
AddFollowersStatus add article to followers status
// AddFollowersStatus add article to followers status
func (user *User) AddFollowersStatus(aid string) {
	pipe := cache.RedisClient.TxPipeline()
	defer func() {
		_, err := pipe.Exec()
		if err != nil {
			util.Log().Error("redis pipeline 执行失败", err)
		}
	}()
	followers, _ := user.Followers(0, user.FollowerCnt())
	followers = append(followers, *user)
	for _, f := range followers {
		pipe.ZAdd(cache.UserStatusKey(f.ID), redis.Z{
			Score:  float64(time.Now().Unix()),
			Member: aid,
		})
		user.TrimStatusPipe(pipe)
	}
}
func ( user * User ) AddFollowersStatus ( aid string ) { pipe := cache . RedisClient . TxPipeline ( ) defer func ( ) { _ , err := pipe . Exec ( ) if err != nil { util . Log ( ) . Error ( " } } ( ) followers , _ := user . Followers ( 0 , user . FollowerCnt ( ) ) followers = append ( followers , * user ) for _ , f := range followers { pipe . ZAdd ( cache . UserStatusKey ( f . ID ) , redis . Z { Score : float64 ( time . Now ( ) . Unix ( ) ) , Member : aid , } ) user . TrimStatusPipe ( pipe ) } }
AddFollowersStatus add article to followers status
AddFollowersStatus add article to followers status
// every user is following himself