Esempio n. 1
0
def cb_dianru_ios(request):
    ret = {}
    ret['message'] = 'ok'

    #logger.info('cb_dianru_ios request params: ' + ' '.join(request.GET.keys()))
    try:
        hashid = request.GET.get('hashid')
        appid = request.GET.get('appid')
        adid = request.GET.get('adid')
        adname = unquote( request.GET.get('adname') )
        userid = request.GET.get('userid')
        deviceid = request.GET.get('deviceid')
        source = request.GET.get('source')
        point = int( request.GET.get('point') )
        ts = request.GET.get('ts')
        checksum = request.GET.get('checksum')

        logger.info('cb_dianru_ios  deviceid:' + deviceid + '  point:' + str(point))
        records = Dianru.objects.filter(hashid=hashid, deviceid=deviceid)
        if len(records) == 0:
            Dianru.objects.create(hashid=hashid, appid=appid, adid=adid, adname=adname,
            userid=userid, deviceid=deviceid, source=source, point=point, ts=ts )

            #update user point record
            user = User.objects.get(dev_id=deviceid)
            PointRecord.objects.create(user=user, channel=u'点入', task=adname, point=point, status='ok')
            user.total_points += point
            user.save()

            cb_apns_notify(user.token, adname, point) 
    finally:
        return SuccessResponse(ret)
Esempio n. 2
0
def cb_dianjoy_ios(request):

    try:
        snuid = request.GET.get('snuid')
        device_id = request.GET.get('device_id')
        app_id = request.GET.get('app_id')
        currency = int( request.GET.get('currency') )
        app_ratio = float( request.GET.get('app_ratio') )
        time_stamp = request.GET.get('time_stamp')
        ad_name = unquote( request.GET.get('ad_name') )
        pack_name = request.GET.get('pack_name')
        token = request.GET.get('token')

        check_token(time_stamp, token)

        logger.info('cb_dianjoy_ios  device_id:' + device_id + '  currency:' + str(currency))
        records = Dianjoy.objects.filter(device_id=device_id, ad_name=ad_name)
        if len(records) == 0:
            Dianjoy.objects.create(snuid=snuid, device_id=device_id, app_id=app_id, currency=currency,
            app_ratio=app_ratio, time_stamp=time_stamp, ad_name=ad_name, pack_name=pack_name)

            #update user point record
            user = User.objects.get(dev_id=device_id)
            PointRecord.objects.create(user=user, channel=u'点乐', task=ad_name, point=currency, status='ok')
            user.total_points += currency
            user.save()

            cb_apns_notify(user.token, ad_name, currency)
    finally:
        return HttpResponse('200')
Esempio n. 3
0
def cb_miidi_ios(request):
    ret = {}
    ret['message'] = 'success'

    try:
        adid = request.GET.get('id')
        trand_no = request.GET.get('trand_no')
        cash = int (request.GET.get('cash') )
        imei = request.GET.get('imei')
        bundleId = request.GET.get('bundleId')
        param0 = request.GET.get('param0')
        appName = unquote( request.GET.get('appName') )
        sign = request.GET.get('sign')
        
        param = adid + trand_no + str(cash) + param0
        check_sign(param, sign)  

        logger.info('cb_miidi_ios  imei:' + imei + '  cash:' + str(cash))
        records = Miidi.objects.filter(imei=imei, trand_no=trand_no)
        if len(records) == 0:
            Miidi.objects.create(adid=adid, trand_no=trand_no, cash=cash, imei=imei,
            bundleId=bundleId, param0=param0, appName=appName )

            #update user point record
            user = User.objects.get(dev_id=imei)
            PointRecord.objects.create(user=user, channel=u'米迪', task=appName, point=cash, status='ok')
            user.total_points += cash
            user.save()

            cb_apns_notify(user.token, appName, cash) 
    finally:
        return SuccessResponse(ret)
Esempio n. 4
0
def cb_guomob_ios(request):
    ret = {}
    ret['message'] = 'ok'

    logger.info('cb_guomob_ios request params: ' + ' '.join(request.GET.keys()))
    try:
        order = request.GET.get('order')
        app = request.GET.get('app')
        ad = unquote( request.GET.get('ad') )
        adsid = request.GET.get('adsid')
        device = request.GET.get('device')
        mac = request.GET.get('mac')
        idfa = request.GET.get('idfa')
        openudid = request.GET.get('openudid')
        price = float( request.GET.get('price') )
        points = int( request.GET.get('points') )
        time = request.GET.get('time')
        sign = request.GET.get('sign')

        logger.info('cb_guomob_ios  device:' + device + '  points:' + str(points))
        records = Guomob.objects.filter(order=order, device=device)
        if len(records) == 0:
            Guomob.objects.create(order=order, app=app, ad=ad, adsid=adsid,
            device=device, mac=mac, idfa=idfa, openudid=openudid, price=price, points=points, time=time )

            #update user point record
            user = User.objects.get(dev_id=device)
            PointRecord.objects.create(user=user, channel=u'果盟', task=ad, point=points, status='ok')
            user.total_points += points
            user.save()

            cb_apns_notify(user.token, ad, points)
    finally:
        return SuccessResponse(ret)
Esempio n. 5
0
def cb_chukong_ios(request):

    logger.info('cb_chukong_ios request params: ' + ' '.join(request.GET.keys()))
    try:
        os = request.GET.get('os')
        os_version = request.GET.get('os_version')
        idfa = request.GET.get('idfa')
        mac = request.GET.get('mac')
        imei = request.GET.get('imei')
        ip = request.GET.get('ip')
        transactionid = request.GET.get('transactionid')
        coins = int( request.GET.get('coins') )
        adid = request.GET.get('adid')
        adtitle = unquote( request.GET.get('adtitle') )
        taskname = unquote( request.GET.get('taskname') )
        taskcontent = unquote( request.GET.get('taskcontent') )
        token = request.GET.get('token')
        sign = request.GET.get('sign')

        logger.info('cb_chukong_ios  idfa:' + idfa + '  coins:' + str(coins))
        records = Chukong.objects.filter(transactionid=transactionid, adid=adid)
        if len(records) == 0:
            Chukong.objects.create(os=os, os_version=os_version, idfa=idfa, mac=mac,
            imei=imei, ip=ip, transactionid=transactionid, coins=coins,
            adid=adid, adtitle=adtitle, taskname=taskname, taskcontent=taskcontent, token=token)

            #update user point record
            user = User.objects.get(dev_id=idfa)
            PointRecord.objects.create(user=user, channel=u'触控', task=adtitle, point=coins, status='ok')
            user.total_points += coins
            user.save()

            cb_apns_notify(user.token, adtitle, coins) 
    finally:
        return HttpResponse('success')
Esempio n. 6
0
def cb_mopan_ios(request):

    try:
        imei = request.GET.get('imei')
        param0 = request.GET.get('param0', '')
        cash = int( request.GET.get('cash') )
        trand_no = request.GET.get('trand_no')
        adid = request.GET.get('id')
        appShowName = unquote( request.GET.get('appShowName') )
        sign = request.GET.get('sign')

        param = adid + trand_no + str(cash) + param0
        check_sign(param, sign) 

        logger.info('cb_mopan_ios  imei:' + imei + '  cash:' + str(cash))
        records = Mopan.objects.filter(trand_no=trand_no, imei=imei)
        if len(records) == 0:
            Mopan.objects.create(imei=imei, param0=param0, cash=cash, trand_no=trand_no,
            adid=adid, appShowName=appShowName)

            #update user point record
            user = User.objects.get(dev_id=imei)
            PointRecord.objects.create(user=user, channel=u'磨盘', task=appShowName, point=cash, status='ok')
            user.total_points += cash
            user.save()

            cb_apns_notify(user.token, appShowName, cash) 
    finally:
        return HttpResponse('success')
Esempio n. 7
0
def cb_adwo_ios(request):
    ret = {}
    try:    
        appid = request.GET.get('appid')
        adname = unquote( request.GET.get('adname') )
        adid = request.GET.get('adid')
        device = request.GET.get('device')
        idfa = request.GET.get('idfa')
        point = int(request.GET.get('point'))
        ts = int(request.GET.get('ts'))
        sign = request.GET.get('sign')
        
        param = "adid=%sadname=%sappid=%sdevice=%sidfa=%spoint=%dts=%skey=" \
                %(adid, adname, appid, device, idfa, point,ts)
        check_sign(param, sign)   

        logger.info('cb_adwo_ios  device:' + device + '  point:' + str(point))
        records = Adwo.objects.filter(device=device, idfa=idfa, ts=ts)
        if len(records) == 0:
            Adwo.objects.create(appid=appid, adname=adname, adid=adid, device=device, idfa=idfa, point=point, ts=ts)
            
            #update user point record
            user = User.objects.get(dev_id=idfa)
            PointRecord.objects.create(user=user, channel=u'安沃', task=adname, point=point, status='ok')
            user.total_points += point
            user.save()

            cb_apns_notify(user.token, adname, point)
    finally:
        return HttpResponse('success')
Esempio n. 8
0
def cb_waps_ios(request):
    ret = {}
    ret['message'] = u'成功接收'

    try:
        adv_id = request.GET.get('adv_id')
        app_id = request.GET.get('app_id')
        key = request.GET.get('key')
        udid = request.GET.get('udid')
        open_udid = request.GET.get('open_udid')
        bill = float(request.GET.get('bill'))
        points = int(request.GET.get('points'))
        ad_name = unquote(request.GET.get('ad_name'))
        status = request.GET.get('status')
        activate_time = request.GET.get('activate_time')
        order_id = request.GET.get('order_id')
        random_code = request.GET.get('random_code')
        wapskey = request.GET.get('wapskey')

        logger.info('cb_waps_ios  udid:' + udid + '  points:' + str(points))
        records = Waps.objects.filter(udid=udid,
                                      open_udid=open_udid,
                                      order_id=order_id)
        if len(records) == 0:
            Waps.objects.create(adv_id=adv_id,
                                app_id=app_id,
                                key=key,
                                udid=udid,
                                open_udid=open_udid,
                                bill=bill,
                                points=points,
                                ad_name=ad_name,
                                status=status,
                                activate_time=activate_time,
                                order_id=order_id)

            #update user point record
            user = User.objects.get(dev_id=udid)
            PointRecord.objects.create(user=user,
                                       channel=u'万普',
                                       task=ad_name,
                                       point=points,
                                       status='ok')
            user.total_points += points
            user.save()

            cb_apns_notify(user.token, ad_name, points)
    finally:
        return SuccessResponse(ret)
Esempio n. 9
0
def cb_guomob_ios(request):
    ret = {}
    ret['message'] = 'ok'

    logger.info('cb_guomob_ios request params: ' +
                ' '.join(request.GET.keys()))
    try:
        order = request.GET.get('order')
        app = request.GET.get('app')
        ad = unquote(request.GET.get('ad'))
        adsid = request.GET.get('adsid')
        device = request.GET.get('device')
        mac = request.GET.get('mac')
        idfa = request.GET.get('idfa')
        openudid = request.GET.get('openudid')
        price = float(request.GET.get('price'))
        points = int(request.GET.get('points'))
        time = request.GET.get('time')
        sign = request.GET.get('sign')

        logger.info('cb_guomob_ios  device:' + device + '  points:' +
                    str(points))
        records = Guomob.objects.filter(order=order, device=device)
        if len(records) == 0:
            Guomob.objects.create(order=order,
                                  app=app,
                                  ad=ad,
                                  adsid=adsid,
                                  device=device,
                                  mac=mac,
                                  idfa=idfa,
                                  openudid=openudid,
                                  price=price,
                                  points=points,
                                  time=time)

            #update user point record
            user = User.objects.get(dev_id=device)
            PointRecord.objects.create(user=user,
                                       channel=u'果盟',
                                       task=ad,
                                       point=points,
                                       status='ok')
            user.total_points += points
            user.save()

            cb_apns_notify(user.token, ad, points)
    finally:
        return SuccessResponse(ret)
Esempio n. 10
0
def cb_youmi_ios(request):
    try:
        order = request.GET.get('order')
        app = request.GET.get('app')
        ad = unquote(request.GET.get('ad'))
        adid = request.GET.get('adid')
        user = request.GET.get('user')
        device = request.GET.get('device')
        chn = request.GET.get('chn')
        price_raw = request.GET.get('price')
        price = float(price_raw)
        point = int(request.GET.get('points'))
        ts = request.GET.get('time')
        sig = request.GET.get('sig')
        sign = request.GET.get('sign')

        param = "ad=%sadid=%sapp=%schn=%sdevice=%sorder=%spoints=%dprice=%ssig=%stime=%suser=%s" \
                %(ad, adid, app, chn, device, order, point, price_raw, sig, ts, user)
        check_sign(param, sign)

        logger.info('cb_youmi_ios  device:' + device + '  point:' + str(point))
        records = Youmi.objects.filter(order=order, device=device)
        if len(records) == 0:
            Youmi.objects.create(type='ios',
                                 order=order,
                                 app=app,
                                 ad=ad,
                                 adid=str(adid),
                                 user=user,
                                 device=device,
                                 chn=chn,
                                 price=price,
                                 point=point,
                                 ts=ts)

            #update user point record
            user = User.objects.get(dev_id=device)
            PointRecord.objects.create(user=user,
                                       channel=u'有米',
                                       task=ad,
                                       point=point,
                                       status='ok')
            user.total_points += point
            user.save()

            cb_apns_notify(user.token, ad, point)
    finally:
        return HttpResponse('success')
Esempio n. 11
0
def cb_yjf_ios(request):
    ret = {}
    ret['message'] = 'ok'

    #logger.info('cb_yjf_ios request params: ' + ' '.join(request.GET.keys()))
    try:
        uuid = request.GET.get('uuid')
        userId = request.GET.get('userId')
        score = int(request.GET.get('score'))
        exchangetime = request.GET.get('exchangetime')
        plat = request.GET.get('plat')
        idfa = request.GET.get('idfa')
        appName = unquote(request.GET.get('appName'))
        adId = request.GET.get('adId')
        adName = unquote(request.GET.get('adName'))
        sign = request.GET.get('sign')

        logger.info('cb_yjf_ios  idfa:' + idfa + '  score:' + str(score))
        records = Yijifen.objects.filter(uuid=uuid,
                                         idfa=idfa,
                                         exchangetime=exchangetime)
        if len(records) == 0:
            Yijifen.objects.create(uuid=uuid,
                                   userId=userId,
                                   score=score,
                                   exchangetime=exchangetime,
                                   plat=plat,
                                   idfa=idfa,
                                   appName=appName,
                                   adId=adId,
                                   adName=adName)

            #update user point record
            user = User.objects.get(dev_id=idfa)
            PointRecord.objects.create(user=user,
                                       channel=u'易积分',
                                       task=adName,
                                       point=score,
                                       status='ok')
            user.total_points += score
            user.save()

            cb_apns_notify(user.token, adName, score)
    finally:
        return SuccessResponse(ret)
Esempio n. 12
0
def cb_dianru_ios(request):
    ret = {}
    ret['message'] = 'ok'

    #logger.info('cb_dianru_ios request params: ' + ' '.join(request.GET.keys()))
    try:
        hashid = request.GET.get('hashid')
        appid = request.GET.get('appid')
        adid = request.GET.get('adid')
        adname = unquote(request.GET.get('adname'))
        userid = request.GET.get('userid')
        deviceid = request.GET.get('deviceid')
        source = request.GET.get('source')
        point = int(request.GET.get('point'))
        ts = request.GET.get('ts')
        checksum = request.GET.get('checksum')

        logger.info('cb_dianru_ios  deviceid:' + deviceid + '  point:' +
                    str(point))
        records = Dianru.objects.filter(hashid=hashid, deviceid=deviceid)
        if len(records) == 0:
            Dianru.objects.create(hashid=hashid,
                                  appid=appid,
                                  adid=adid,
                                  adname=adname,
                                  userid=userid,
                                  deviceid=deviceid,
                                  source=source,
                                  point=point,
                                  ts=ts)

            #update user point record
            user = User.objects.get(dev_id=deviceid)
            PointRecord.objects.create(user=user,
                                       channel=u'点入',
                                       task=adname,
                                       point=point,
                                       status='ok')
            user.total_points += point
            user.save()

            cb_apns_notify(user.token, adname, point)
    finally:
        return SuccessResponse(ret)
Esempio n. 13
0
def cb_miidi_ios(request):
    ret = {}
    ret['message'] = 'success'

    try:
        adid = request.GET.get('id')
        trand_no = request.GET.get('trand_no')
        cash = int(request.GET.get('cash'))
        imei = request.GET.get('imei')
        bundleId = request.GET.get('bundleId')
        param0 = request.GET.get('param0')
        appName = unquote(request.GET.get('appName'))
        sign = request.GET.get('sign')

        param = adid + trand_no + str(cash) + param0
        check_sign(param, sign)

        logger.info('cb_miidi_ios  imei:' + imei + '  cash:' + str(cash))
        records = Miidi.objects.filter(imei=imei, trand_no=trand_no)
        if len(records) == 0:
            Miidi.objects.create(adid=adid,
                                 trand_no=trand_no,
                                 cash=cash,
                                 imei=imei,
                                 bundleId=bundleId,
                                 param0=param0,
                                 appName=appName)

            #update user point record
            user = User.objects.get(dev_id=imei)
            PointRecord.objects.create(user=user,
                                       channel=u'米迪',
                                       task=appName,
                                       point=cash,
                                       status='ok')
            user.total_points += cash
            user.save()

            cb_apns_notify(user.token, appName, cash)
    finally:
        return SuccessResponse(ret)
Esempio n. 14
0
def cb_dianjoy_ios(request):

    try:
        snuid = request.GET.get('snuid')
        device_id = request.GET.get('device_id')
        app_id = request.GET.get('app_id')
        currency = int(request.GET.get('currency'))
        app_ratio = float(request.GET.get('app_ratio'))
        time_stamp = request.GET.get('time_stamp')
        ad_name = unquote(request.GET.get('ad_name'))
        pack_name = request.GET.get('pack_name')
        token = request.GET.get('token')

        check_token(time_stamp, token)

        logger.info('cb_dianjoy_ios  device_id:' + device_id + '  currency:' +
                    str(currency))
        records = Dianjoy.objects.filter(device_id=device_id, ad_name=ad_name)
        if len(records) == 0:
            Dianjoy.objects.create(snuid=snuid,
                                   device_id=device_id,
                                   app_id=app_id,
                                   currency=currency,
                                   app_ratio=app_ratio,
                                   time_stamp=time_stamp,
                                   ad_name=ad_name,
                                   pack_name=pack_name)

            #update user point record
            user = User.objects.get(dev_id=device_id)
            PointRecord.objects.create(user=user,
                                       channel=u'点乐',
                                       task=ad_name,
                                       point=currency,
                                       status='ok')
            user.total_points += currency
            user.save()

            cb_apns_notify(user.token, ad_name, currency)
    finally:
        return HttpResponse('200')
Esempio n. 15
0
def cb_domob_ios(request):
    ret = {}
    ret['message'] = 'success'

    try:
        orderid = request.GET.get('orderid')
        pubid = request.GET.get('pubid')
        ad = unquote( request.GET.get('ad') )
        adid = request.GET.get('adid')
        user = request.GET.get('user')
        device = request.GET.get('device')
        channel = request.GET.get('channel')
        price_raw = request.GET.get('price')
        price = float( price_raw )
        point = int( request.GET.get('point') )
        ts = request.GET.get('ts')
        sign = request.GET.get('sign')

        param = "ad=%sadid=%schannel=%sdevice=%sorderid=%spoint=%dprice=%spubid=%sts=%suser=%s" \
                %(ad, adid, channel, device, orderid, point,price_raw, pubid, ts, user)
        check_sign(param, sign) 

        logger.info('cb_domob_ios  device:' + device + '  point:' + str(point))
        records = Domob.objects.filter(orderid=orderid, device=device)
        if len(records) == 0:
            Domob.objects.create(orderid=orderid, pubid=pubid, ad=ad, adid=adid,
            user=user, device=device, channel=channel, price=price, point=point, ts=ts )

            #update user point record
            user = User.objects.get(dev_id=device)
            PointRecord.objects.create(user=user, channel=u'多盟', task=ad, point=point, status='ok')
            user.total_points += point
            user.save()

            cb_apns_notify(user.token, ad, point)  
    finally:
        return SuccessResponse(ret)
Esempio n. 16
0
def cb_waps_ios(request):
    ret = {}
    ret['message'] = u'成功接收'

    try:
        adv_id = request.GET.get('adv_id')
        app_id = request.GET.get('app_id')
        key = request.GET.get('key')
        udid = request.GET.get('udid')
        open_udid = request.GET.get('open_udid')
        bill = float( request.GET.get('bill') )
        points = int (request.GET.get('points') )
        ad_name = unquote( request.GET.get('ad_name'))
        status = request.GET.get('status')
        activate_time = request.GET.get('activate_time')
        order_id = request.GET.get('order_id')
        random_code = request.GET.get('random_code')
        wapskey = request.GET.get('wapskey')


        logger.info('cb_waps_ios  udid:' + udid + '  points:' + str(points))
        records = Waps.objects.filter(udid=udid, open_udid=open_udid, order_id=order_id)
        if len(records) == 0:
            Waps.objects.create(adv_id=adv_id, app_id=app_id, key=key, udid=udid,
            open_udid=open_udid, bill=bill, points=points, ad_name=ad_name, 
            status=status, activate_time=activate_time, order_id=order_id )

            #update user point record
            user = User.objects.get(dev_id=udid)
            PointRecord.objects.create(user=user, channel=u'万普', task=ad_name, point=points, status='ok')
            user.total_points += points
            user.save()

            cb_apns_notify(user.token, ad_name, points) 
    finally:
        return SuccessResponse(ret)
Esempio n. 17
0
def cb_youmi_ios(request):
    try:
        order = request.GET.get('order')
        app = request.GET.get('app')
        ad = unquote( request.GET.get('ad') )
        adid = request.GET.get('adid')
        user = request.GET.get('user')
        device = request.GET.get('device')
        chn = request.GET.get('chn')
        price_raw = request.GET.get('price')
        price = float(price_raw)
        point = int(request.GET.get('points'))
        ts = request.GET.get('time')
        sig = request.GET.get('sig')
        sign = request.GET.get('sign')

        param = "ad=%sadid=%sapp=%schn=%sdevice=%sorder=%spoints=%dprice=%ssig=%stime=%suser=%s" \
                %(ad, adid, app, chn, device, order, point, price_raw, sig, ts, user)
        check_sign(param, sign)    


        logger.info('cb_youmi_ios  device:' + device + '  point:' + str(point))
        records = Youmi.objects.filter(order=order, device=device)
        if len(records) == 0:
            Youmi.objects.create(type='ios',order=order, app=app, ad=ad, adid=str(adid), user=user, device=device,
            chn=chn, price=price, point=point, ts=ts)

            #update user point record
            user = User.objects.get(dev_id=device)
            PointRecord.objects.create(user=user, channel=u'有米', task=ad, point=point, status='ok')
            user.total_points += point
            user.save()

            cb_apns_notify(user.token, ad, point)
    finally:
        return HttpResponse('success')