Ejemplo n.º 1
0
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})
Ejemplo n.º 2
0
def superlike(request):
    user = request.user
    sid = int(request.POST.get('sid'))
    flag = logic.superlike(user.id, sid)
    return render_json(data={'match': flag})
Ejemplo n.º 3
0
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})
Ejemplo n.º 4
0
def superlike(request):
    '''超级喜欢'''
    sid = int(request.POST.get('sid'))
    is_matched = logic.superlike(request.user, sid)
    return render_json({'is_matched': is_matched})
Ejemplo n.º 5
0
def superlike(request):
    '''超级喜欢'''
    stranger_id = int(request.POST.get('stranger_id'))
    return {'matched': logic.superlike(stranger_id)}