Spaces:
Runtime error
Runtime error
jiarongqiu commited on
Commit ·
ebc5000
1
Parent(s): f6d2aa9
update
Browse files- {routers → router}/__init__.py +0 -0
- util/__init__.py +0 -0
- util/schema.py +42 -0
{routers → router}/__init__.py
RENAMED
|
File without changes
|
util/__init__.py
ADDED
|
File without changes
|
util/schema.py
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
|
| 3 |
+
class Card:
|
| 4 |
+
|
| 5 |
+
def __init__(self, title, description, url):
|
| 6 |
+
self._title = title
|
| 7 |
+
self._description = description
|
| 8 |
+
self._url = url
|
| 9 |
+
|
| 10 |
+
@property
|
| 11 |
+
def title(self):
|
| 12 |
+
return self._title
|
| 13 |
+
|
| 14 |
+
@property
|
| 15 |
+
def description(self):
|
| 16 |
+
return self._description
|
| 17 |
+
|
| 18 |
+
@property
|
| 19 |
+
def url(self):
|
| 20 |
+
return self._url
|
| 21 |
+
|
| 22 |
+
@title.setter
|
| 23 |
+
def title(self, value):
|
| 24 |
+
self._title = value
|
| 25 |
+
|
| 26 |
+
@description.setter
|
| 27 |
+
def description(self, value):
|
| 28 |
+
self._description = value
|
| 29 |
+
|
| 30 |
+
@url.setter
|
| 31 |
+
def url(self, value):
|
| 32 |
+
self._url = value
|
| 33 |
+
|
| 34 |
+
def __str__(self):
|
| 35 |
+
return f"Title: {self.title}\nDescription: {self.description}\nUrl: {self.url}"
|
| 36 |
+
|
| 37 |
+
def to_json(self):
|
| 38 |
+
return {
|
| 39 |
+
"title": self.title,
|
| 40 |
+
"description": self.description,
|
| 41 |
+
"url": self.url
|
| 42 |
+
}
|