Пример #1
0
    def test_log_api(self):
        """
        Test get exist option
        """
        OrcTest.test_print_begin()

        init_log()

        _log = OrcLog("api.test01")

        _log.info("This 001!")
        _log.warning("This 002!")
        _log.error("This 003!")
        _log.critical("This 004!")
        _log.debug("This 005!")

        OrcTest.test_print_end()
Пример #2
0
class ReportDetAPI(Resource):
    def __init__(self):

        self.__logger = OrcLog("resource.report.api.det")
        self.__model = ReportDetModel()

    def dispatch_request(self, *args, **kwargs):
        return super(Resource, self).dispatch_request(*args, **kwargs)

    def get(self, p_id, p_time):
        """
        Search
        :param p_time:
        :param p_id:
        :return:
        """
        self.__logger.info("Get report, parameter is: %s, %s" % (p_id, p_time))

        return self.__model.usr_get_report(p_id, p_time)
Пример #3
0
class RunAPI(Resource):
    def __init__(self):

        self.__logger = OrcLog("resource.run.api")
        self.__model = RunCore()

    def dispatch_request(self, *args, **kwargs):
        return super(Resource, self).dispatch_request(*args, **kwargs)

    @orc_api
    def put(self):
        """
        start
        """
        parameter = OrcParameter.receive_para()

        self.__logger.info("Run, parameter is: %s" % parameter)

        return self.__model.run_start(parameter)
Пример #4
0
class RunDetListAPI(Resource):
    def __init__(self):

        self.__logger = OrcLog("resource.runs.api.det")
        self.__model = RunDetMod()

    def dispatch_request(self, *args, **kwargs):
        return super(Resource, self).dispatch_request(*args, **kwargs)

    @orc_api
    def get(self):
        """
        Search
        :return:
        """
        parameter = OrcParameter.receive_para()

        self.__logger.info("Add run time, parameter is: %s" % parameter)

        return self.__model.usr_search(parameter)
Пример #5
0
class CaseDetListAPI(Resource):

    def __init__(self):

        self.__logger = OrcLog("resource.cases.api.det")
        self.__business = CaseDetBus()

    def dispatch_request(self, *args, **kwargs):
        return super(Resource, self).dispatch_request(*args, **kwargs)

    @orc_api
    def post(self):
        """
        Add
        :return:
        """
        parameter = OrcParameter.receive_para()

        self.__logger.info("Add case, parameter is: %s" % parameter)

        return self.__business.bus_list_add(parameter)

    @orc_api
    def delete(self):
        """
        Delete
        :return:
        """
        parameter = OrcParameter.receive_para()

        self.__logger.info("Delete case, parameter is: %s" % parameter)

        return self.__business.bus_list_delete(parameter)

    @orc_api
    def get(self):
        """
        Search
        :return:
        """
        parameter = OrcParameter.receive_para()

        self.__logger.info("Search case, parameter is: %s" % parameter)

        return self.__business.bus_list_search(parameter)
Пример #6
0
class DictAPI(Resource):
    def __init__(self):

        self.__logger = OrcLog("resource.lib.dict")
        self.__business = DictBus()

    def dispatch_request(self, *args, **kwargs):
        return super(Resource, self).dispatch_request(*args, **kwargs)

    @orc_api
    def delete(self, p_id):
        """
        删除
        :param p_id:
        :return:
        """
        self.__logger.info("Delete dict, parameter is: %s" % p_id)

        return self.__business.bus_delete(p_id)

    @orc_api
    def put(self, p_id):
        """
        更新
        :param p_id:
        :return:
        """
        parameter = OrcParameter.receive_para()

        self.__logger.info("Update dict, parameter is: %s, %s" %
                           (p_id, parameter))

        return self.__business.bus_update(p_id, parameter)

    @orc_api
    def get(self, p_id):
        """
        查询
        :param p_id:
        :return:
        """
        self.__logger.info("Search dict, parameter is: %s" % p_id)

        return self.__business.bus_search(p_id)
Пример #7
0
class DictListAPI(Resource):
    def __init__(self):

        self.__logger = OrcLog("resource.lib.dicts")
        self.__business = DictBus()

    def dispatch_request(self, *args, **kwargs):
        return super(Resource, self).dispatch_request(*args, **kwargs)

    @orc_api
    def post(self):
        """
        新增
        :return:
        """
        parameter = OrcParameter.receive_para()

        self.__logger.info("Add dict, parameter is: %s" % parameter)

        return self.__business.bus_list_add(parameter)

    @orc_api
    def delete(self):
        """
        删除
        :return:
        """
        parameter = OrcParameter.receive_para()

        self.__logger.info("Delete dict, parameter is: %s" % parameter)

        return self.__business.bus_list_delete(parameter)

    @orc_api
    def get(self):
        """
        Search
        :return:
        """
        parameter = OrcParameter.receive_para()

        self.__logger.info("Search dict, parameter is: %s" % parameter)

        return self.__business.bus_list_search(parameter)
Пример #8
0
class RunTimeAPI(Resource):
    def __init__(self):

        self.__logger = OrcLog("resource.run_times.api.def")
        self.__model = RunTimeBus()

    def dispatch_request(self, *args, **kwargs):
        return super(Resource, self).dispatch_request(*args, **kwargs)

    @orc_api
    def get(self, p_id):
        """
        Search
        :param p_id:
        :return:
        """
        self.__logger.info("Search run_times, parameter is: %s" % p_id)

        return self.__model.bus_search(p_id)

    @orc_api
    def put(self, p_id):
        """
        Update
        :param p_id:
        :return:
        """
        parameter = OrcParameter.receive_para()

        self.__logger.info("Update run_times, parameter is: %s, %s" %
                           (p_id, parameter))

        return self.__model.bus_update(p_id, parameter)

    @orc_api
    def delete(self, p_id):
        """
        Delete
        :param p_id:
        :return:
        """
        self.__logger.info("Delete run_times, parameter is: %s" % p_id)

        return self.__model.bus_delete(p_id)
Пример #9
0
class WidgetDefAPI(Resource):
    def __init__(self):

        self.__logger = OrcLog("resource.widget.def")
        self.__business = WidgetDefBus()

    def dispatch_request(self, *args, **kwargs):
        return super(Resource, self).dispatch_request(*args, **kwargs)

    @orc_api
    def get(self, p_id):
        """
        Search
        :param p_id:
        :return:
        """
        self.__logger.info("Search widget, parameter is: %s" % p_id)

        return self.__business.bus_search(p_id)

    @orc_api
    def put(self, p_id):
        """
        Update
        :param p_id:
        :return:
        """
        parameter = OrcParameter.receive_para()

        self.__logger.info("Update widget, parameter is: %s, %s" %
                           (p_id, parameter))

        return self.__business.bus_update(p_id, parameter)

    @orc_api
    def delete(self, p_id):
        """
        Delete
        :param p_id:
        :return:
        """
        self.__logger.info("Delete widget, parameter is: %s" % p_id)

        return self.__business.bus_delete(p_id)
Пример #10
0
class DataListAPI(Resource):
    def __init__(self):

        self.__logger = OrcLog("resource.datas.api")
        self.__model = DataBus()

    def dispatch_request(self, *args, **kwargs):
        return super(Resource, self).dispatch_request(*args, **kwargs)

    @orc_api
    def post(self):
        """
        Add
        :return:
        """
        parameter = OrcParameter.receive_para()

        self.__logger.info("Add data, parameter is: %s" % parameter)

        return self.__model.bus_list_add(parameter)

    @orc_api
    def get(self):
        """
        Search
        :return:
        """
        parameter = OrcParameter.receive_para()

        self.__logger.info("Search data, parameter is: %s" % parameter)

        return self.__model.bus_list_search(parameter)

    @orc_api
    def delete(self):
        """
        Delete
        :return:
        """
        parameter = OrcParameter.receive_para()

        self.__logger.info("Delete data, parameter is: %s" % parameter)

        return self.__model.bus_list_delete(parameter)
Пример #11
0
class WindowListAPI(Resource):
    def __init__(self):

        self.__logger = OrcLog("resource.driver.web.windows")
        self.__business = WindowDefBus()

    def dispatch_request(self, *args, **kwargs):
        return super(Resource, self).dispatch_request(*args, **kwargs)

    @orc_api
    def post(self):
        """
        Add
        :return:
        """
        parameter = OrcParameter.receive_para()

        self.__logger.info("Add window, parameter is: %s" % parameter)

        return self.__business.bus_list_add(parameter)

    @orc_api
    def delete(self):
        """
        Delete
        :return:
        """
        parameter = OrcParameter.receive_para()

        self.__logger.info("Delete window, parameter is: %s" % parameter)

        return self.__business.bus_list_delete(parameter)

    @orc_api
    def get(self):
        """
        Search
        :return:
        """
        parameter = OrcParameter.receive_para()

        self.__logger.info("Search window, parameter is: %s" % parameter)

        return self.__business.bus_list_search(parameter)