/*
 * @Author: Student author@example.com
 * @Date: 2025-01-02 01:17:31
 * @LastEditors: Student author@example.com
 * @LastEditTime: 2025-01-03 01:46:12
 * @FilePath: \LibraryManageSystem\main.cpp
 * @Description: Coding with UTF-8
 *
 * Copyright (c) 2025 by Student, All Rights Reserved.
 */

#include "include/UI.h"
#include "include/LibrarySystem.h"
#include <Windows.h>
#include <iostream>

int main()
{
    try
    {
        std::cout << "程序启动..." << std::endl;

        SetConsoleOutputCP(CP_UTF8);
        SetConsoleCP(CP_UTF8);

        std::cout << "初始化系统..." << std::endl;
        LibrarySystem system;

        std::cout << "系统初始化完成" << std::endl;

        std::cout << "创建UI..." << std::endl;
        UI ui(system);
        std::cout << "UI创建完成" << std::endl;

        std::cout << "启动主界面..." << std::endl;
        ui.start();
        std::cout << "程序正常退出" << std::endl;

        return 0;
    }
    catch (const std::exception &e)
    {
        std::cerr << "错误: " << e.what() << std::endl;
        return 1;
    }
}
