def is_determined(self): if self.request_type == 'IntentRequest' and Utils.get_dict_data_by_keys( self.data, ['request', 'determined']): return Utils.get_dict_data_by_keys(self.data, ['request', 'determined']) else: return False
def get_user_id(self): """ 获取用户ID :return: """ return Utils.get_dict_data_by_keys( self.data, ['context', 'System', 'user', 'userId'])
def get_user_info(self): """ 获取用户信息 :return: """ return Utils.get_dict_data_by_keys(self.data, ['context', 'System', 'user', 'userInfo'])
def get_screen_card_from_context(self): """ 获取屏幕card信息 :return: """ return Utils.get_dict_data_by_keys(self.data, ['context', 'Screen', 'card'])
def get_app_launcher_context(self): """ 获取设备app安装列表 :return: """ return Utils.get_dict_data_by_keys(self.data, ['context', 'AppLauncher'])
def get_api_endpoint(self): """ 获取apiEndPoint :return: """ return Utils.get_dict_data_by_keys( self.data, ['context', 'System', 'apiEndPoint'])
def get_audio_player_context(self): """ 获取设备音频播放状态 :return: """ return Utils.get_dict_data_by_keys(self.data, ['context', 'AudioPlayer'])
def get_screen_token_from_context(self): """ 获取屏幕数据中的token :return: """ return Utils.get_dict_data_by_keys(self.data, ['context', 'Screen', 'token'])
def get_video_player_context(self): """ 获取设备的视频播放状态 :return: """ return Utils.get_dict_data_by_keys(self.data, ['context', 'VideoPlayer'])
def get_original_device_id(self): """ 获取来自端上报的原始设备Id :return: """ return Utils.get_dict_data_by_keys( self.data, ['context', 'System', 'device', 'originalDeviceId'])
def get_device_id(self): """ 获取设备Id :return: """ return Utils.get_dict_data_by_keys( self.data, ['context', 'System', 'device', 'deviceId'])
def get_api_access_token(self): """ 获取ApiAccessToken 申请授权的时候使用 :return: """ return Utils.get_dict_data_by_keys( self.data, ['context', 'System', 'apiAccessToken'])
def get_screen_context(self): """ 获取设备的屏幕信息 :return: """ return Utils.get_dict_data_by_keys(self.data, ['context', 'Screen'])
def get_baidu_uid(self): """ 获取百度Id :return: """ return Utils.get_dict_data_by_keys(self.data, ['context', 'System', 'user', 'userInfo', 'account', 'baidu', 'baiduUid'])
def get_template_token(self): data = self.request.get_data() token = '' if data and Utils.checkKeysInDict(data, ['context', 'Screen', 'token']): token = Utils.get_dict_data_by_keys(data, ['context', 'Screen', 'token']) return token
def get_query(self): """ 获取请求的Query :return: """ if self.request_type == 'IntentRequest' and self.data['request']['query']['original']: return Utils.get_dict_data_by_keys(self.data, ['request', 'query', 'original']) else: return ''
def get_video_player_context(self): return Utils.get_dict_data_by_keys(self.data, ['context', 'VideoPlayer'])
def get_screen_context(self): return Utils.get_dict_data_by_keys(self.data, ['context', 'Screen'])
def get_supported_interfaces(self): return Utils.get_dict_data_by_keys(self.data, ['context', 'System', 'device', 'supportedInterfaces'])
def get_bot_id(self): return Utils.get_dict_data_by_keys(self.data, ['context', 'System', 'application', 'applicationId'])
def get_log_id(self): return Utils.get_dict_data_by_keys(self.data, ['request', 'requestId'])
def get_timestamp(self): return Utils.get_dict_data_by_keys(self.data, ['request', 'timestamp'])
def get_token(self): return Utils.get_dict_data_by_keys(self.data, ['token'])
def get_token(self): return Utils.get_dict_data_by_keys(self.data, ['audioItem', 'stream', 'token'])
def _get_system_user(self): return Utils.get_dict_data_by_keys(self.data, ['context', 'System', 'user'])