mirror of
https://github.com/cqwu-ehall/cqwu-ehall.git
synced 2024-11-22 02:55:33 +00:00
17b1f9bd55
* ✨ Support gen_pay_qrcode raise error * ✨ Support BaseModel for get_calendar --------- Co-authored-by: brian <brian@xtaolabs.com>
22 lines
517 B
Python
22 lines
517 B
Python
from typing import List
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class AiCourse(BaseModel):
|
|
name: str # 课程名称
|
|
position: str # 上课地点
|
|
teacher: str # 上课老师
|
|
weeks: List[int] # 上课周数
|
|
day: int # 星期
|
|
start_num: int # 开始节数
|
|
sections: int # 连上节数
|
|
|
|
@property
|
|
def key(self):
|
|
return f"{','.join([str(i) for i in self.weeks])}_{self.day}_{self.sections}"
|
|
|
|
@property
|
|
def second_key(self):
|
|
return f"{self.day}_{self.sections}"
|