使用Parse实现转推/转发功​​能 [英] Implement a retweet/reshare functionality using Parse

查看:67
本文介绍了使用Parse实现转推/转发功​​能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在这个话题上停留了一段时间了,所以任何指导都将不胜感激.

I've been stuck on this topic for awhile now, so any guidance would be appreciated.

设置如下:用户A跟随用户B,但不跟随用户C.用户B转贴了用户C的帖子.重新转贴的帖子现在作为用户C的原始帖子显示在用户A的供稿中,并由用户B转贴

Here's the setup: User A is following user B, but not user C. User B reshares a post from user C. The reshared post now shows up in user A's feed as the original post from user C and reshared by user B.

对它的结构看起来真的很困惑.我正在使用Parse,因此可以安全地假设我具有标准的Users类和Posts类.

Really confused on what the structure of this looks like. I'm using Parse so it's safe to assume that I have the standard Users class and a Posts class.

推荐答案

我将在您的Posts类中添加一个引用列,该列可以保存对另一篇文章的引用.当用户B重新共享该帖子时,您将在Posts类中创建一个新条目,该条目包含对原始帖子的引用,但被列为B的帖子.

I would add a reference column to your Posts class that can hold a reference to another post. When user B re-shares the post you create a new entry in the Posts class that contains the reference to the original post but is listed as a post from B.

现在,当您检索也订阅了A的帖子时,您将获得重新发布"-您需要按照引用从C获取原始内容.如果允许重新发布,则可以需要重复这种取消引用的操作,直到获得原始帖子为止.

Now when you retrieve the posts that A is subscribed too, you will get the "repost" - you need to follow the reference to get the original content from C. If you allow re-posts of re-posts then you may need to repeat this de-referencing until you get to the original post.

这篇关于使用Parse实现转推/转发功​​能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆