def _add(self):
        _request = json.loads(self.request.body)
        _app_uuid = _request.get("app_uuid")
        _group_uuid = _request.get("group_uuid")
        _script_answer = _request.get("script_answer")
        _script_question = _request.get("script_question")

        if _script_answer == None or len(_script_answer) == 0:
            self.setErrorCode(API_ERR.NO_PARA)
            return
        
        _uuid = str(uuid.uuid1())
        
        _row = PredefinedScript(uuid=_uuid, app_uuid=_app_uuid, group_uuid=_group_uuid,
                                script_question=_script_question, script_answer=_script_answer)
        _row.async_add()
        _row.create_redis_keys(self.application.redis)
        _ret = self.getReturnData()
        _ret = copy.deepcopy(_request)
        _ret["uuid"] = _uuid
        return
Example #2
0
    def _add(self):
        _request = json.loads(self.request.body)
        _app_uuid = _request.get("app_uuid")
        _group_uuid = _request.get("group_uuid")
        _script_answer = _request.get("script_answer")
        _script_question = _request.get("script_question")

        if _script_answer == None or len(_script_answer) == 0:
            self.setErrorCode(API_ERR.NO_PARA)
            return

        _uuid = str(uuid.uuid1())

        _row = PredefinedScript(uuid=_uuid,
                                app_uuid=_app_uuid,
                                group_uuid=_group_uuid,
                                script_question=_script_question,
                                script_answer=_script_answer)
        _row.async_add()
        _row.create_redis_keys(self.application.redis)
        _ret = self.getReturnData()
        _ret = copy.deepcopy(_request)
        _ret["uuid"] = _uuid
        return