def superlike(request): user = request.user # 在swipe中创建一条记录. sid = request.POST.get('sid') # 超级喜欢加7分 key = keys.HOT_RANK_KEY % sid rds.zincrby(config.RANK_KEY, config.SUPERLIKE_SCORE, key) flag = logic.superlike(user.id, int(sid)) if flag: return render_json(data={'matched': True}) return render_json(data={'matched': False})
def superlike(request): user = request.user sid = int(request.POST.get('sid')) flag = logic.superlike(user.id, sid) return render_json(data={'match': flag})
def superlike(request): '''超级喜欢''' sid = int(request.POST.get('sid')) is_match = logic.superlike(request.user, sid) log.info(f'{request.user.id} superlike {sid}') return render_json({'is_match': is_match})
def superlike(request): '''超级喜欢''' sid = int(request.POST.get('sid')) is_matched = logic.superlike(request.user, sid) return render_json({'is_matched': is_matched})
def superlike(request): '''超级喜欢''' stranger_id = int(request.POST.get('stranger_id')) return {'matched': logic.superlike(stranger_id)}