def dislike(request): '''不喜欢''' sid = int(request.POST.get('sid')) Swiped.dislike(request.user.id, sid) logic.add_swipe_score(sid, 'dislike') rds.srem('RCMD-%s' % request.user.id, sid) return render_json(None)
def superlike(request): '''超级喜欢''' sid = int(request.POST.get('sid')) is_matched = logic.superlike_someone(request.user, sid) logic.add_swipe_score(sid, 'superlike') rds.srem('RCMD-%s' % request.user.id, sid) return render_json({'is_matched': is_matched})
def like(request): """喜欢""" sid = int(request.POST.get('sid')) logic.add_swipe_score(sid, 'like') is_matched = logic.like_someone(request.user, sid) rds.srem('RCMD-%s' % request.user.id, sid) return render_json({'is_matched': is_matched})
def dislike(request): """ 不喜欢 :param request: :return: """ sid = int(request.POST.get('sid')) user = request.user ret = Swiped.swipe(uid=user.id, sid=sid, mark='dislike') # 只有滑动成功后,才可以进行增加积分操作 if ret: logic.add_swipe_score('dislike', sid) return render_json()
def dislike(request): sid = int(request.POST.get("sid")) Swiped.dislike(request.user.id,sid) logic.add_swipe_score(sid,'dislike') rds.srem('RCMD-%s' % request.user.id, sid) # 删除redis集合中的某一个值 return render_json(None)
def superlike(request): sid = int(request.POST.get("sid")) is_matched = logic.superlike_someone(request.user, sid) logic.add_swipe_score(sid,'superlike') rds.srem('RCMD-%s' % request.user.id, sid) # 删除redis集合中的某一个值 return render_json({'is_matched':is_matched})