-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathevent.py
69 lines (52 loc) · 1.54 KB
/
event.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import datetime
from .base import Base, CommentEventGet, GroupGet, LecturerGet, RoomGet
class EventPatch(Base):
name: str | None = None
room_id: list[int] | None = None
group_id: list[int] | None = None
lecturer_id: list[int] | None = None
start_ts: datetime.datetime | None = None
end_ts: datetime.datetime | None = None
def __repr__(self):
return (
f"Lesson(name={self.name},"
f" room={self.room_id}, group={self.group_id},"
f" lecturer={self.lecturer_id}, start_ts={self.start_ts}, end_ts={self.end_ts})"
)
class EventPost(Base):
name: str
room_id: list[int]
group_id: list[int]
lecturer_id: list[int]
start_ts: datetime.datetime
end_ts: datetime.datetime
def __repr__(self):
return (
f"Lesson(name={self.name},"
f" room={self.room_id}, group={self.group_id},"
f" lecturer={self.lecturer_id}, start_ts={self.start_ts}, end_ts={self.end_ts})"
)
class Event(Base):
id: int
name: str
room: list[RoomGet]
group: list[GroupGet]
lecturer: list[LecturerGet]
start_ts: datetime.datetime
end_ts: datetime.datetime
class GetListEvent(Base):
items: list[Event]
limit: int
offset: int
total: int
class EventCommentPost(Base):
text: str
author_name: str
class EventCommentPatch(Base):
text: str | None = None
author_name: str | None = None
class EventComments(Base):
items: list[CommentEventGet]
limit: int
offset: int
total: int