def _create_device(self):

        _osmodel = self.input_data.get("osmodel")
        _osversion = self.input_data.get("osversion")
        _device_fullname = self.input_data.get("device_fullname")
        
        _is_development = bool(self.input_data.get("ios_app_development"))

        _device_ios_token = self.input_data.get("device_ios_token")
        _device_android_gcmtoken = self.input_data.get("device_android_gcmtoken")
        _device_android_jpush_registrationid = self.input_data.get("device_android_jpush_registrationid")
        
        _device_uuid = str(uuid.uuid1())
        _values = {
            "uuid": _device_uuid,
            "terminal_uuid": self._terminal_uuid,
            "user_uuid": self.user.get("uuid"),
            "device_ostype": self._ostype,
            "device_ios_model": _osmodel,
            "device_osversion": _osversion,
            "device_fullname": _device_fullname,

            "is_development": _is_development,
            
            "device_ios_token": _device_ios_token,
            "device_android_gcmtoken": _device_android_gcmtoken,
            "device_android_jpush_registrationid": _device_android_jpush_registrationid,

        }

        _row = DeviceInfo(**_values)
        _row.create_redis_keys(self.application.redis)
        _row.async_add(self.application.redis)
        return _values
Exemple #2
0
 def _create_device(self):
     _osmodel = self.input_data.get("osmodel")
     _osversion = self.input_data.get("osversion")
     _device_fullname = self.input_data.get("device_fullname")
     _device_uuid = str(uuid.uuid1())
     _values = {
         "uuid": _device_uuid,
         "terminal_uuid": self._terminal_uuid,
         "user_uuid": self.user.get("uuid"),
         "device_ostype": self._ostype,
         "device_ios_model": _osmodel,
         "device_osversion": _osversion,
         "device_fullname": _device_fullname
     }
     _row = DeviceInfo(**_values)
     _row.create_redis_keys(self.application.redis)
     _row.async_add(self.application.redis)
     return _values
 def _create_device(self):
     _osmodel = self.input_data.get("osmodel")
     _osversion = self.input_data.get("osversion")
     _device_fullname = self.input_data.get("device_fullname")
     _device_uuid = str(uuid.uuid1())
     _values = {
         "uuid": _device_uuid,
         "terminal_uuid": self._terminal_uuid,
         "user_uuid": self.user.get("uuid"),
         "device_ostype": self._ostype,
         "device_ios_model": _osmodel,
         "device_osversion": _osversion,
         "device_fullname": _device_fullname        
     }
     _row = DeviceInfo(**_values)
     _row.create_redis_keys(self.application.redis)
     _row.async_add(self.application.redis)
     return _values
Exemple #4
0
    def _create_device(self):

        _osmodel = self.input_data.get("osmodel")
        _osversion = self.input_data.get("osversion")
        _device_fullname = self.input_data.get("device_fullname")

        _is_development = bool(self.input_data.get("ios_app_development"))

        _device_ios_token = self.input_data.get("device_ios_token")
        _device_android_gcmtoken = self.input_data.get(
            "device_android_gcmtoken")
        _device_android_jpush_registrationid = self.input_data.get(
            "device_android_jpush_registrationid")

        _device_uuid = str(uuid.uuid1())
        _values = {
            "uuid":
            _device_uuid,
            "terminal_uuid":
            self._terminal_uuid,
            "user_uuid":
            self.user.get("uuid"),
            "device_ostype":
            self._ostype,
            "device_ios_model":
            _osmodel,
            "device_osversion":
            _osversion,
            "device_fullname":
            _device_fullname,
            "is_development":
            _is_development,
            "device_ios_token":
            _device_ios_token,
            "device_android_gcmtoken":
            _device_android_gcmtoken,
            "device_android_jpush_registrationid":
            _device_android_jpush_registrationid,
        }

        _row = DeviceInfo(**_values)
        _row.create_redis_keys(self.application.redis)
        _row.async_add(self.application.redis)
        return _values
    def _create(self):
        _redis = self.application.redis
        _device_uuid = None
        _terminal_uuid = self._device_id

        _key = DeviceInfo.__tablename__ + ".terminal_uuid." + _terminal_uuid
        if _redis.exists(_key):
            self._existed(_redis.get(_key))
            return

        _device_uuid = str(uuid.uuid1())
        _row = DeviceInfo(uuid=_device_uuid, app_uuid=self._app_uuid, user_uuid=self._user_uuid, is_ppcom_device=True,
                          device_ostype=self._device_ostype, terminal_uuid=_terminal_uuid)
        _row.async_add(self.application.redis)
        _row.create_redis_keys(self.application.redis)

        self._user(_device_uuid)
        _rdata = self.getReturnData()
        _rdata["device_uuid"] = _device_uuid
        return
    def _create(self):
        _redis = self.application.redis
        _device_uuid = None
        _terminal_uuid = self._device_id

        _key = DeviceInfo.__tablename__ + ".terminal_uuid." + _terminal_uuid
        if _redis.exists(_key):
            self._existed(_redis.get(_key))
            return

        _device_uuid = str(uuid.uuid1())
        _row = DeviceInfo(uuid=_device_uuid,
                          user_uuid=self._user_uuid,
                          is_ppcom_device=True,
                          device_ostype=self._device_ostype,
                          terminal_uuid=_terminal_uuid)
        _row.async_add(self.application.redis)
        _row.create_redis_keys(self.application.redis)

        self._user(_device_uuid)
        _rdata = self.getReturnData()
        _rdata["device_uuid"] = _device_uuid
        return
    def _create_device(self):
        _token = self.input_data.get("token")
        _osmodel = self.input_data.get("osmodel")
        _osversion = self.input_data.get("osversion")
        _device_fullname = self.input_data.get("device_fullname")
        _is_development = bool(self.input_data.get("ios_app_development"))

        _ios_token = None
        _gcm_token = None
        _gcm_push = False
        if self._ostype == OS.IOS:
            _ios_token = _token
        if self._ostype == OS.AND:
            _gcm_token = _token
        if _gcm_token != None:
            _gcm_push = True
            
        _device_uuid = str(uuid.uuid1())
        _values = {
            "uuid": _device_uuid,
            "terminal_uuid": self._terminal_uuid,
            "user_uuid": self.user.get("uuid"),
            "device_ostype": self._ostype,
            "device_ios_token": _ios_token,
            "device_ios_model": _osmodel,
            "device_osversion": _osversion,
            "device_fullname": _device_fullname,
            "is_development": _is_development,
            "device_android_gcmtoken": _gcm_token,
            "device_android_gcmpush": _gcm_push
        }

        _row = DeviceInfo(**_values)
        _row.create_redis_keys(self.application.redis)
        _row.async_add()
        return _values
    def _create_device(self):
        _token = self.input_data.get("token")
        _osmodel = self.input_data.get("osmodel")
        _osversion = self.input_data.get("osversion")
        _device_fullname = self.input_data.get("device_fullname")
        _is_development = bool(self.input_data.get("ios_app_development"))

        _ios_token = None
        _gcm_token = None
        _gcm_push = False
        if self._ostype == OS.IOS:
            _ios_token = _token
        if self._ostype == OS.AND:
            _gcm_token = _token
        if _gcm_token != None:
            _gcm_push = True

        _device_uuid = str(uuid.uuid1())
        _values = {
            "uuid": _device_uuid,
            "terminal_uuid": self._terminal_uuid,
            "user_uuid": self.user.get("uuid"),
            "device_ostype": self._ostype,
            "device_ios_token": _ios_token,
            "device_ios_model": _osmodel,
            "device_osversion": _osversion,
            "device_fullname": _device_fullname,
            "is_development": _is_development,
            "device_android_gcmtoken": _gcm_token,
            "device_android_gcmpush": _gcm_push
        }

        _row = DeviceInfo(**_values)
        _row.create_redis_keys(self.application.redis)
        _row.async_add(self.application.redis)
        return _values