def _open(self, _user_uuid, _conversation_uuid):
     _redis = self.application.redis
     _key = ConversationUserData.__tablename__ + \
            ".user_uuid." + _user_uuid + \
            ".conversation_uuid." + _conversation_uuid
     _data_uuid = _redis.get(_key)
     if _data_uuid == None:
         self.setErrorCode(API_ERR.NO_CONVERSATION)
         return
     
     _row = ConversationUserData(uuid=_data_uuid, conversation_status=CONVERSATION_STATUS.OPEN)
     _row.async_update(_redis)
     _row.update_redis_keys(_redis)
     return
 def _close(self, _conversation_uuid, _user_uuid):
     _redis = self.application.redis
     _key = ConversationUserData.__tablename__ + \
            ".user_uuid." + _user_uuid + \
            ".conversation_uuid." + _conversation_uuid
     _uuid = _redis.get(_key)
     if _uuid == None:
         logging.error("no such conversation data: %s" % _key)
         self.setErrorCode(API_ERR.NO_CONVERSATION)
         return
     _row = ConversationUserData(uuid=_uuid, conversation_status=CONVERSATION_STATUS.CLOSE)
     _row.async_update(_redis)
     _row.update_redis_keys(_redis)
     return
示例#3
0
    def _open(self, _user_uuid, _conversation_uuid):
        _redis = self.application.redis
        _key = ConversationUserData.__tablename__ + \
               ".user_uuid." + _user_uuid + \
               ".conversation_uuid." + _conversation_uuid
        _data_uuid = _redis.get(_key)
        if _data_uuid == None:
            self.setErrorCode(API_ERR.NO_CONVERSATION)
            return

        _row = ConversationUserData(
            uuid=_data_uuid, conversation_status=CONVERSATION_STATUS.OPEN)
        _row.async_update(_redis)
        _row.update_redis_keys(_redis)
        return
 def _close(self, _conversation_uuid, _user_uuid):
     _redis = self.application.redis
     _key = ConversationUserData.__tablename__ + \
            ".user_uuid." + _user_uuid + \
            ".conversation_uuid." + _conversation_uuid
     _uuid = _redis.get(_key)
     if _uuid == None:
         logging.error("no such conversation data: %s" % _key)
         self.setErrorCode(API_ERR.NO_CONVERSATION)
         return
     _row = ConversationUserData(
         uuid=_uuid, conversation_status=CONVERSATION_STATUS.CLOSE)
     _row.async_update(_redis)
     _row.update_redis_keys(_redis)
     return