예제 #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})
예제 #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})
예제 #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})
예제 #4
0
파일: api.py 프로젝트: muzili0903/swiper
def superlike(request):
    '''超级喜欢'''
    sid = int(request.POST.get('sid'))
    is_matched = logic.superlike(request.user, sid)
    return render_json({'is_matched': is_matched})
예제 #5
0
def superlike(request):
    '''超级喜欢'''
    stranger_id = int(request.POST.get('stranger_id'))
    return {'matched': logic.superlike(stranger_id)}