Example #1
0
 def delete(self, user_id_to):
     '''取消关注'''
     user_id = authutil.get_user_id(g.ukey)
     try:
         backend.unfollow_user(user_id, user_id_to)
     except BackendError, ex:
         raise
Example #2
0
 def delete(self,user_id_to):
     '''取消关注'''
     user_id = authutil.get_user_id(g.ukey)
     try:
         backend.unfollow_user(user_id,user_id_to)
     except BackendError,ex:
         raise 
Example #3
0
 def delete(self,post_id):
     post = backend.get_post(post_id)
     curr_id = authutil.get_user_id(g.ukey)
     if post['author_id'] != curr_id:
         return jsonify(error='forbid')
     try:
         backend.set_post(post_id,{'show':'deleted_by_user'})
     except BackendError,ex:
         abort(501)
Example #4
0
 def delete(self, post_id):
     post = backend.get_post(post_id)
     curr_id = authutil.get_user_id(g.ukey)
     if post["author_id"] != curr_id:
         return jsonify(error="forbid")
     try:
         backend.set_post(post_id, {"show": "deleted_by_user"})
     except BackendError, ex:
         abort(501)
Example #5
0
 def post(self):
     '''关注用户'''
     data = UserFollowSchema().deserialize(request.json)
     from_id = authutil.get_user_id(g.ukey)
     for uid in data['user_ids']:
         try:
             backend.follow_user(from_id, uid)
             backend.add_activity({
                 'from_id': from_id,
                 'to_id': uid,
                 'atype': 'follow'
             })
         except BackendError, ex:
             pass
Example #6
0
 def post(self):
     '''关注用户'''
     data = UserFollowSchema().deserialize(request.json)
     from_id = authutil.get_user_id(g.ukey)
     for uid in data['user_ids']:
         try:
             backend.follow_user(from_id,uid)
             backend.add_activity({
                     'from_id':from_id,
                     'to_id':uid,
                     'atype':'follow'
                 })
         except BackendError,ex:
             pass
Example #7
0
 def get(self, user_id_to):
     user_id = authutil.get_user_id(g.ukey)
     ret = backend.is_following_user(user_id, user_id_to)
     return jsonify(is_follow=ret)
Example #8
0
 def get(self,user_id_to):
     user_id = authutil.get_user_id(g.ukey)
     ret = backend.is_following_user(user_id,user_id_to)
     return jsonify(is_follow=ret)