models module#
- pydantic model models.Course[源代码]#
基类:
BaseModel
单个课程信息模型
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "Course", "description": "\u5355\u4e2a\u8bfe\u7a0b\u4fe1\u606f\u6a21\u578b", "type": "object", "properties": { "course_code": { "title": "Course Code", "type": "string" }, "course_name": { "title": "Course Name", "type": "string" }, "date": { "title": "Date", "type": "string" }, "end_time": { "title": "End Time", "type": "string" }, "end_unit": { "title": "End Unit", "type": "integer" }, "lesson_id": { "title": "Lesson Id", "type": "integer" }, "lesson_no": { "title": "Lesson No", "type": "string" }, "rooms": { "items": { "$ref": "#/$defs/Room" }, "title": "Rooms", "type": "array" }, "start_time": { "title": "Start Time", "type": "string" }, "start_unit": { "title": "Start Unit", "type": "integer" }, "teachclass_std_count": { "title": "Teachclass Std Count", "type": "integer" }, "teachers": { "items": { "$ref": "#/$defs/Teacher" }, "title": "Teachers", "type": "array" }, "weeks": { "title": "Weeks", "type": "string" }, "weekstate": { "title": "Weekstate", "type": "string" } }, "$defs": { "Room": { "description": "\u6559\u5ba4\u4fe1\u606f\u6a21\u578b", "properties": { "address": { "title": "Address", "type": "string" }, "building": { "title": "Building", "type": "string" }, "code": { "title": "Code", "type": "string" }, "id": { "title": "Id", "type": "integer" }, "latitude": { "default": "", "title": "Latitude", "type": "string" }, "longitude": { "default": "", "title": "Longitude", "type": "string" }, "name": { "title": "Name", "type": "string" } }, "required": [ "address", "building", "code", "id", "name" ], "title": "Room", "type": "object" }, "Teacher": { "description": "\u6559\u5e08\u4fe1\u606f\u6a21\u578b", "properties": { "code": { "title": "Code", "type": "string" }, "id": { "title": "Id", "type": "integer" }, "name": { "title": "Name", "type": "string" } }, "required": [ "code", "id", "name" ], "title": "Teacher", "type": "object" } }, "required": [ "course_code", "course_name", "date", "end_time", "end_unit", "lesson_id", "lesson_no", "rooms", "start_time", "start_unit", "teachclass_std_count", "teachers", "weeks", "weekstate" ] }
- Fields:
- field course_code: str [Required]#
课程代码
- field course_name: str [Required]#
课程名称
- field date: str [Required]#
上课日期,格式为YYYY-MM-DD
- field end_time: str [Required]#
下课时间,格式为HH:MM
- field end_unit: int [Required]#
结束节次
- field lesson_id: int [Required]#
课程ID
- field lesson_no: str [Required]#
课程编号
- field start_time: str [Required]#
上课时间,格式为HH:MM
- field start_unit: int [Required]#
开始节次
- field teachclass_std_count: int [Required]#
班级学生数量
- field weeks: str [Required]#
周次
- field weekstate: str [Required]#
周状态
- pydantic model models.Courses[源代码]#
基类:
BaseModel
课程列表模型
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "Courses", "description": "\u8bfe\u7a0b\u5217\u8868\u6a21\u578b", "type": "object", "properties": { "courses": { "description": "\u8bfe\u7a0b\u5217\u8868", "items": { "$ref": "#/$defs/Course" }, "title": "Courses", "type": "array" } }, "$defs": { "Course": { "description": "\u5355\u4e2a\u8bfe\u7a0b\u4fe1\u606f\u6a21\u578b", "properties": { "course_code": { "title": "Course Code", "type": "string" }, "course_name": { "title": "Course Name", "type": "string" }, "date": { "title": "Date", "type": "string" }, "end_time": { "title": "End Time", "type": "string" }, "end_unit": { "title": "End Unit", "type": "integer" }, "lesson_id": { "title": "Lesson Id", "type": "integer" }, "lesson_no": { "title": "Lesson No", "type": "string" }, "rooms": { "items": { "$ref": "#/$defs/Room" }, "title": "Rooms", "type": "array" }, "start_time": { "title": "Start Time", "type": "string" }, "start_unit": { "title": "Start Unit", "type": "integer" }, "teachclass_std_count": { "title": "Teachclass Std Count", "type": "integer" }, "teachers": { "items": { "$ref": "#/$defs/Teacher" }, "title": "Teachers", "type": "array" }, "weeks": { "title": "Weeks", "type": "string" }, "weekstate": { "title": "Weekstate", "type": "string" } }, "required": [ "course_code", "course_name", "date", "end_time", "end_unit", "lesson_id", "lesson_no", "rooms", "start_time", "start_unit", "teachclass_std_count", "teachers", "weeks", "weekstate" ], "title": "Course", "type": "object" }, "Room": { "description": "\u6559\u5ba4\u4fe1\u606f\u6a21\u578b", "properties": { "address": { "title": "Address", "type": "string" }, "building": { "title": "Building", "type": "string" }, "code": { "title": "Code", "type": "string" }, "id": { "title": "Id", "type": "integer" }, "latitude": { "default": "", "title": "Latitude", "type": "string" }, "longitude": { "default": "", "title": "Longitude", "type": "string" }, "name": { "title": "Name", "type": "string" } }, "required": [ "address", "building", "code", "id", "name" ], "title": "Room", "type": "object" }, "Teacher": { "description": "\u6559\u5e08\u4fe1\u606f\u6a21\u578b", "properties": { "code": { "title": "Code", "type": "string" }, "id": { "title": "Id", "type": "integer" }, "name": { "title": "Name", "type": "string" } }, "required": [ "code", "id", "name" ], "title": "Teacher", "type": "object" } } }
- Fields:
- pydantic model models.DeviceParams[源代码]#
基类:
BaseModel
设备参数模型
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "DeviceParams", "description": "\u8bbe\u5907\u53c2\u6570\u6a21\u578b", "type": "object", "properties": { "deviceName": { "title": "Devicename", "type": "string" }, "deviceId": { "title": "Deviceid", "type": "string" }, "deviceInfo": { "title": "Deviceinfo", "type": "string" }, "deviceInfos": { "title": "Deviceinfos", "type": "string" }, "userAgentPrecursor": { "title": "Useragentprecursor", "type": "string" } }, "required": [ "deviceName", "deviceId", "deviceInfo", "deviceInfos", "userAgentPrecursor" ] }
- field deviceId: str [Required]#
设备ID
- field deviceInfo: str [Required]#
设备信息
- field deviceInfos: str [Required]#
设备详细信息
- field deviceName: str [Required]#
设备名称
- field userAgentPrecursor: str [Required]#
用户代理前缀
- pydantic model models.LoginResult[源代码]#
基类:
BaseModel
登录结果模型
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "LoginResult", "description": "\u767b\u5f55\u7ed3\u679c\u6a21\u578b", "type": "object", "properties": { "success": { "title": "Success", "type": "boolean" }, "usercode": { "title": "Usercode", "type": "string" }, "name": { "title": "Name", "type": "string" }, "user_token": { "title": "User Token", "type": "string" }, "refresh_token": { "title": "Refresh Token", "type": "string" }, "dynamic_secret": { "title": "Dynamic Secret", "type": "string" }, "dynamic_token": { "title": "Dynamic Token", "type": "string" }, "biz_type_id": { "title": "Biz Type Id", "type": "integer" }, "current_semester_id": { "title": "Current Semester Id", "type": "integer" } }, "required": [ "success", "usercode", "name", "user_token", "refresh_token", "dynamic_secret", "dynamic_token", "biz_type_id", "current_semester_id" ] }
- Fields:
- field biz_type_id: int [Required]#
业务类型 ID,区分本科生与研究生
- field current_semester_id: int [Required]#
当前学期 ID
- field dynamic_secret: str [Required]#
动态 Secret
- field dynamic_token: str [Required]#
动态 Token
- field name: str [Required]#
用户姓名
- field refresh_token: str [Required]#
刷新 Token
- field success: bool [Required]#
登录是否成功
- field user_token: str [Required]#
用户 Token
- field usercode: str [Required]#
学号
- pydantic model models.OnlineDevice[源代码]#
基类:
BaseModel
在线设备信息模型
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "OnlineDevice", "description": "\u5728\u7ebf\u8bbe\u5907\u4fe1\u606f\u6a21\u578b", "type": "object", "properties": { "brasid": { "title": "Brasid", "type": "string" }, "downFlow": { "title": "Downflow", "type": "string" }, "hostName": { "default": "", "title": "Hostname", "type": "string" }, "ip": { "title": "Ip", "type": "string" }, "loginTime": { "title": "Logintime", "type": "string" }, "mac": { "title": "Mac", "type": "string" }, "sessionId": { "title": "Sessionid", "type": "string" }, "terminalType": { "title": "Terminaltype", "type": "string" }, "upFlow": { "title": "Upflow", "type": "string" }, "useTime": { "title": "Usetime", "type": "string" }, "userId": { "title": "Userid", "type": "integer" } }, "required": [ "brasid", "downFlow", "ip", "loginTime", "mac", "sessionId", "terminalType", "upFlow", "useTime", "userId" ] }
- Fields:
- field brasid: str [Required]#
BRAS ID
- field downFlow: str [Required]#
下行流量
- field hostName: str = ''#
主机名
- field ip: str [Required]#
IP地址
- field loginTime: str [Required]#
登录时间,格式为YYYY-MM-DD HH:MM:SS
- field mac: str [Required]#
MAC地址
- field sessionId: str [Required]#
会话ID
- field terminalType: str [Required]#
终端类型
- field upFlow: str [Required]#
上行流量
- field useTime: str [Required]#
使用时间(秒)
- field userId: int [Required]#
用户ID
- pydantic model models.OnlineDevices[源代码]#
基类:
BaseModel
在线设备列表模型
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "OnlineDevices", "description": "\u5728\u7ebf\u8bbe\u5907\u5217\u8868\u6a21\u578b", "type": "object", "properties": { "devices": { "description": "\u5728\u7ebf\u8bbe\u5907\u5217\u8868", "items": { "$ref": "#/$defs/OnlineDevice" }, "title": "Devices", "type": "array" } }, "$defs": { "OnlineDevice": { "description": "\u5728\u7ebf\u8bbe\u5907\u4fe1\u606f\u6a21\u578b", "properties": { "brasid": { "title": "Brasid", "type": "string" }, "downFlow": { "title": "Downflow", "type": "string" }, "hostName": { "default": "", "title": "Hostname", "type": "string" }, "ip": { "title": "Ip", "type": "string" }, "loginTime": { "title": "Logintime", "type": "string" }, "mac": { "title": "Mac", "type": "string" }, "sessionId": { "title": "Sessionid", "type": "string" }, "terminalType": { "title": "Terminaltype", "type": "string" }, "upFlow": { "title": "Upflow", "type": "string" }, "useTime": { "title": "Usetime", "type": "string" }, "userId": { "title": "Userid", "type": "integer" } }, "required": [ "brasid", "downFlow", "ip", "loginTime", "mac", "sessionId", "terminalType", "upFlow", "useTime", "userId" ], "title": "OnlineDevice", "type": "object" } } }
- field devices: List[OnlineDevice] [Optional]#
在线设备列表
- classmethod from_list(devices_list: List[Dict[str, Any]]) OnlineDevices [源代码]#
从设备列表创建OnlineDevices对象
- pydantic model models.Room[源代码]#
基类:
BaseModel
教室信息模型
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "Room", "description": "\u6559\u5ba4\u4fe1\u606f\u6a21\u578b", "type": "object", "properties": { "address": { "title": "Address", "type": "string" }, "building": { "title": "Building", "type": "string" }, "code": { "title": "Code", "type": "string" }, "id": { "title": "Id", "type": "integer" }, "latitude": { "default": "", "title": "Latitude", "type": "string" }, "longitude": { "default": "", "title": "Longitude", "type": "string" }, "name": { "title": "Name", "type": "string" } }, "required": [ "address", "building", "code", "id", "name" ] }
- field address: str [Required]#
教室地址
- field building: str [Required]#
所在建筑
- field code: str [Required]#
教室代码
- field id: int [Required]#
教室ID
- field latitude: str = ''#
纬度
- field longitude: str = ''#
经度
- field name: str [Required]#
教室名称
- pydantic model models.RoomOccupancy[源代码]#
基类:
BaseModel
教室占用信息模型
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "RoomOccupancy", "description": "\u6559\u5ba4\u5360\u7528\u4fe1\u606f\u6a21\u578b", "type": "object", "properties": { "building_code": { "title": "Building Code", "type": "string" }, "building_name": { "title": "Building Name", "type": "string" }, "campus_code": { "title": "Campus Code", "type": "string" }, "campus_name": { "title": "Campus Name", "type": "string" }, "floor": { "title": "Floor", "type": "string" }, "occupy_units": { "title": "Occupy Units", "type": "string" }, "room_capacity": { "title": "Room Capacity", "type": "integer" }, "room_code": { "title": "Room Code", "type": "string" }, "room_id": { "title": "Room Id", "type": "string" }, "room_name": { "title": "Room Name", "type": "string" }, "room_type": { "title": "Room Type", "type": "string" } }, "required": [ "building_code", "building_name", "campus_code", "campus_name", "floor", "occupy_units", "room_capacity", "room_code", "room_id", "room_name", "room_type" ] }
- Fields:
- field building_code: str [Required]#
建筑代码
- field building_name: str [Required]#
建筑名称
- field campus_code: str [Required]#
校区代码
- field campus_name: str [Required]#
校区名称
- field floor: str [Required]#
楼层
- field occupy_units: str [Required]#
占用单元,字符串形式的二进制表示(1表示占用,0表示空闲)
- field room_capacity: int [Required]#
教室容量
- field room_code: str [Required]#
教室代码
- field room_id: str [Required]#
教室ID
- field room_name: str [Required]#
教室名称
- field room_type: str [Required]#
教室类型
- pydantic model models.RoomOccupancyData[源代码]#
基类:
BaseModel
教室占用数据模型
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "RoomOccupancyData", "description": "\u6559\u5ba4\u5360\u7528\u6570\u636e\u6a21\u578b", "type": "object", "properties": { "date": { "title": "Date", "type": "string" }, "max_unit": { "title": "Max Unit", "type": "integer" }, "rooms": { "items": { "$ref": "#/$defs/RoomOccupancy" }, "title": "Rooms", "type": "array" } }, "$defs": { "RoomOccupancy": { "description": "\u6559\u5ba4\u5360\u7528\u4fe1\u606f\u6a21\u578b", "properties": { "building_code": { "title": "Building Code", "type": "string" }, "building_name": { "title": "Building Name", "type": "string" }, "campus_code": { "title": "Campus Code", "type": "string" }, "campus_name": { "title": "Campus Name", "type": "string" }, "floor": { "title": "Floor", "type": "string" }, "occupy_units": { "title": "Occupy Units", "type": "string" }, "room_capacity": { "title": "Room Capacity", "type": "integer" }, "room_code": { "title": "Room Code", "type": "string" }, "room_id": { "title": "Room Id", "type": "string" }, "room_name": { "title": "Room Name", "type": "string" }, "room_type": { "title": "Room Type", "type": "string" } }, "required": [ "building_code", "building_name", "campus_code", "campus_name", "floor", "occupy_units", "room_capacity", "room_code", "room_id", "room_name", "room_type" ], "title": "RoomOccupancy", "type": "object" } }, "required": [ "date", "max_unit", "rooms" ] }
- field date: str [Required]#
日期,格式为YYYY-MM-DD
- field max_unit: int [Required]#
最大单元数(一天中的时间段总数)
- field rooms: List[RoomOccupancy] [Required]#
教室占用信息列表
- get_available_rooms(unit_index: int) List[RoomOccupancy] [源代码]#
获取指定时间单元可用的教室列表
- 参数:
unit_index – 时间单元索引(从1开始)
- 返回:
可用教室列表
- 返回类型:
List[RoomOccupancy]
- 抛出:
ValueError – 如果时间单元索引超出范围
- pydantic model models.Semester[源代码]#
基类:
BaseModel
学期模型
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "Semester", "description": "\u5b66\u671f\u6a21\u578b", "type": "object", "properties": { "code": { "title": "Code", "type": "string" }, "end_date": { "title": "End Date", "type": "string" }, "id": { "title": "Id", "type": "string" }, "name": { "title": "Name", "type": "string" }, "season": { "title": "Season", "type": "string" }, "start_date": { "title": "Start Date", "type": "string" }, "week_start_day": { "title": "Week Start Day", "type": "integer" }, "year": { "title": "Year", "type": "string" } }, "required": [ "code", "end_date", "id", "name", "season", "start_date", "week_start_day", "year" ] }
- Fields:
- field code: str [Required]#
学期号
- field end_date: str [Required]#
学期结束日期
- field id: str [Required]#
学期 ID
- field name: str [Required]#
学期名
- field season: str [Required]#
学期季节
- field start_date: str [Required]#
学期开始日期
- field week_start_day: int [Required]#
学期周起始日
- field year: str [Required]#
学期年份
- pydantic model models.SemesterData[源代码]#
基类:
BaseModel
学期数据模型
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "SemesterData", "description": "\u5b66\u671f\u6570\u636e\u6a21\u578b", "type": "object", "properties": { "cur_semester_id": { "title": "Cur Semester Id", "type": "integer" }, "semesters": { "items": { "$ref": "#/$defs/Semester" }, "title": "Semesters", "type": "array" } }, "$defs": { "Semester": { "description": "\u5b66\u671f\u6a21\u578b", "properties": { "code": { "title": "Code", "type": "string" }, "end_date": { "title": "End Date", "type": "string" }, "id": { "title": "Id", "type": "string" }, "name": { "title": "Name", "type": "string" }, "season": { "title": "Season", "type": "string" }, "start_date": { "title": "Start Date", "type": "string" }, "week_start_day": { "title": "Week Start Day", "type": "integer" }, "year": { "title": "Year", "type": "string" } }, "required": [ "code", "end_date", "id", "name", "season", "start_date", "week_start_day", "year" ], "title": "Semester", "type": "object" } }, "required": [ "cur_semester_id", "semesters" ] }
- field cur_semester_id: int [Required]#
默认学期ID
- pydantic model models.Teacher[源代码]#
基类:
BaseModel
教师信息模型
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "Teacher", "description": "\u6559\u5e08\u4fe1\u606f\u6a21\u578b", "type": "object", "properties": { "code": { "title": "Code", "type": "string" }, "id": { "title": "Id", "type": "integer" }, "name": { "title": "Name", "type": "string" } }, "required": [ "code", "id", "name" ] }
- Fields:
- field code: str [Required]#
教师代码
- field id: int [Required]#
教师ID
- field name: str [Required]#
教师姓名