示例#1
0
文件: api.py 项目: SceneryCN/swiper
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)
示例#2
0
文件: api.py 项目: SceneryCN/swiper
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})
示例#3
0
def super_like(request):
    """超喜欢"""
    user = request.user
    sid = int(request.POST.get('sid'))
    is_matched = super_like_someone(user, sid)
    add_swipe_score(sid, 'superlike')  # 添加滑动排行
    rds.srem('RCMD-%s' % request.user.id, sid)
    return render_json({'is_matched': is_matched})
示例#4
0
def dislike(request):
    """不喜欢"""
    user = request.user
    sid = int(request.POST.get('sid'))
    Swiped.dislike(user.id, sid)
    add_swipe_score(sid, 'dislike')  # 添加滑动排行
    rds.srem('RCMD-%s' % request.user.id, sid)
    return render_json(None)
示例#5
0
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)
示例#6
0
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})