我有两个实体BlogPost和用户im不确定下面的机制是如何工作的,我已经在S.O上搜索过了,但是没有得到一个主意
我的想法
我认为follow是某种
Get posts where userID = ?
但它也应该是一个持续的过程,即当用户再次发帖时,它应该自动获得新的帖子,直到用户展开。
我想就如何实施和我需要什么提出一些建议。
我想创造的东西
我想创建一个订阅用户的服务(比如在linkedIn这样的社交网络中,这样用户就可以通过让所有用户获得新的活动,比如新的帖子(新的上传)来跟踪另一个用户
public void subscribeToUser(String id){
//follow a user by id
//im not sure the relationship i should create between the entities
// user and posts so that when one user creates a post
// another user can subscribe to the first user and can see all the posts and future posts of the user
}
}