You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
824 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

from src.dal.csv_dal import CSVStudentDAL
from src.dal.json_dal import JSONStudentDAL
from src.dal.sqlite_dal import SQLiteStudentDAL
from src.bll.student_service import StudentService
from src.ui.console_ui import ConsoleUI
def main():
# 选择数据存储方式
print("请选择数据存储方式:")
print("1. CSV文件")
print("2. JSON文件")
print("3. SQLite数据库")
choice = input("请选择(1-3): ").strip()
if choice == "1":
dal = CSVStudentDAL()
elif choice == "2":
dal = JSONStudentDAL()
elif choice == "3":
dal = SQLiteStudentDAL()
else:
print("无效选择默认使用CSV文件存储")
dal = CSVStudentDAL()
service = StudentService(dal)
ui = ConsoleUI(service)
ui.run()
if __name__ == "__main__":
main()