from 预定系统.Base.base import fetch_and_parse_check_txt

if __name__ == "__main__":
    # 使用示例
    # url = "https://192.168.5.218:8443/media/file/check.txt"
    # save_directory = r"D:\GithubData\自动化\ubains-module-test\预定系统\reports"  # 指定保存目录
    # filename = "check.txt"
    # download_file(url, save_directory, filename)

    # 使用示例
    url = "https://192.168.5.218:8443/media/file/check.txt"
    save_path = "check.txt"
    extract_info = ['[m]ysql', '[r]edis', '[f]dfs_storaged', '[f]dfs_tracker', '[e]mqx',
                    'ubains-meeting-api-1.0-SNAPSHOT.jar', 'ubains-meeting-inner-api-1.0-SNAPSHOT.jar', 'uwsgi']

    info = fetch_and_parse_check_txt(url, save_path, extract_info)
    if info:
        for key, value in info.items():
            print(f"{key} 服务的状态是 {value}")
    else:
        print("无法获取或解析文件内容")