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.
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 abc import ABC , abstractmethod
from typing import List , Optional
from . . model . student import Student
class IStudentDAL ( ABC ) :
""" 学生信息数据访问层接口 """
@abstractmethod
def get_by_id ( self , id_card : str ) - > Optional [ Student ] :
""" 根据身份证号获取学生信息, 返回Student对象或None """
pass
@abstractmethod
def get_by_stu_id ( self , stu_id : str ) - > Optional [ Student ] :
""" 根据学号获取学生信息, 返回Student对象或None """
pass
@abstractmethod
def get_all ( self ) - > List [ Student ] :
""" 获取所有学生信息, 返回Student对象列表 """
pass
@abstractmethod
def add ( self , student : Student ) - > bool :
""" 添加学生信息,返回操作结果 """
pass
@abstractmethod
def update ( self , student : Student ) - > bool :
""" 更新学生信息,返回操作结果 """
pass
@abstractmethod
def delete_by_id ( self , id_card : str ) - > bool :
""" 根据身份证号删除学生信息,返回操作结果 """
pass
@abstractmethod
def delete_by_stu_id ( self , stu_id : str ) - > bool :
""" 根据学号删除学生信息,返回操作结果 """
pass
@abstractmethod
def search_by_name ( self , name : str ) - > List [ Student ] :
""" 根据姓名模糊查询学生信息 """
pass
@abstractmethod
def search_by_class ( self , class_name : str ) - > List [ Student ] :
""" 根据班级模糊查询学生信息 """
pass
@abstractmethod
def search_by_major ( self , major : str ) - > List [ Student ] :
""" 根据专业模糊查询学生信息 """
pass