日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

python 級別聯動實現

系統 1790 0
            
              from utils.httputil import Http
from utils.dbQry import MyDbUtil

http = Http()
mydb = MyDbUtil()


def query_interface():
    list = mydb.select_some("systems", "switch", 1)
    nodes = mydb.select_some("node", "switch", 1)
    tasks = mydb.select_some("task", "switch", 1)
    apis = mydb.select_some("apis", "switch", 1)

    if list:
        treelist = []
        for node in list:
            system = {"sys_id": node.get("id"), "sys_name": node.get("name"), "children": []}
            treelist.append(system)

        for tl in treelist:
            if nodes:
                for node in nodes:
                    if tl.get('sys_id') == node.get('systems_id'):
                        node2 = {"node_id": node.get("id"), "node_name": node.get("name"), "children": []}
                        if tasks:
                            for task in tasks:
                                if node.get("id") == task.get('node_id'):
                                    node3 = {"task_id": task.get("id"), "task_name": task.get("name"),
                                             "task_result": task.get("expected"),
                                             "expression": eval(task.get("expression")),
                                             "frequency": task.get("frequency"), "children": []}
                                    node2['children'].append(node3)
                                    if apis:
                                        for api in apis:
                                            if task.get("id") == api.get("task_id"):
                                                node4 = {"api_id": api.get("id"), "api_name": api.get("name"),
                                                         "method": api.get("method"), "url": api.get("url"),
                                                         "params": api.get("params")}
                                                node3['children'].append(node4)
                        tl['children'].append(node2)

        return treelist
    else:
        return None

    # rs = http.doHttp(method=interface.get("method"), url=interface.get("url"), data=json.dumps(interface.get("params")))
    # print("CCC",rs)


if __name__:
    rs = query_interface()

            
          

更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 宿迁市| 武定县| 金门县| 漳平市| 石河子市| 晋州市| 大名县| 三江| 沧源| 光山县| 海门市| 麦盖提县| 湛江市| 青浦区| 麻江县| 兖州市| 平南县| 融水| 东辽县| 西宁市| 苏州市| 青神县| 简阳市| 尼玛县| 忻州市| 徐州市| 肇州县| 桐柏县| 新丰县| 织金县| 亚东县| 弥勒县| 博乐市| 阿合奇县| 丰台区| 图木舒克市| 门源| 乐安县| 长春市| 五家渠市| 三门峡市|