View Code? Open in Web Editor
NEW
The simple TikTok backend which supports video Feed stream, video contribution, personal information, like list, user comments, follow list, fan list, etc.
License: GNU General Public License v3.0
tiktok's Issues
根据follower表:
userid:用户
followerid:关注的用户
而在followDao中,获取关注列表函数:
func (*FollowDao) GetFollowingIds(userId int64) ([]int64, error) { var ids []int64 if err := Db. Model(Follow{}). Where("follower_id = ?", userId). Pluck("user_id", &ids).Error; nil != err { // 没有关注任何人,但是不能算错。 if "record not found" == err.Error() { return nil, nil } // 查询出错。 log.Println(err.Error()) return nil, err } // 查询成功。 return ids, nil }
follower_id =userId,即关注了userId 的 所有用户ids , 应该是userId的粉丝列表叭?
同样地,在获取粉丝列表函数中:
func (*FollowDao) GetFollowersIds(userId int64) ([]int64, error) { var ids []int64 if err := Db. Model(Follow{}). Where("user_id = ?", userId). Where("cancel = ?", 0). Pluck("follower_id", &ids).Error; nil != err { // 没有粉丝,但是不能算错。 if "record not found" == err.Error() { return nil, nil } // 查询出错。 log.Println(err.Error()) return nil, err } // 查询成功。 return ids, nil }
user_id = userId,即当前用户userId 关注的所有用户ids, 应该是关注列表?
您好,在视频设计模块的文档中,我注意到参考文献里面有nginx服务器的相关信息,我想知道为什么需要nginx服务器,如果直接把视频文件存在本地,然后返回play_url的时候,内容是自己主机的ip address+filepath,这样能实现在客户端上播放视频的功能吗?谢谢了
通过修改通信协议使用HTTPS协议来下发响应,使得信息传输更加安全