noticecard 0.1.0__py3-none-any.whl → 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- noticecard/__init__.py +1 -1
- noticecard/app.py +5 -7
- noticecard/cli.py +1 -1
- noticecard/models.py +1 -2
- noticecard/schemas.py +4 -7
- noticecard/templates.py +6 -14
- {noticecard-0.1.0.dist-info → noticecard-0.2.0.dist-info}/METADATA +3 -5
- noticecard-0.2.0.dist-info/RECORD +11 -0
- noticecard-0.1.0.dist-info/RECORD +0 -11
- {noticecard-0.1.0.dist-info → noticecard-0.2.0.dist-info}/WHEEL +0 -0
- {noticecard-0.1.0.dist-info → noticecard-0.2.0.dist-info}/entry_points.txt +0 -0
- {noticecard-0.1.0.dist-info → noticecard-0.2.0.dist-info}/top_level.txt +0 -0
noticecard/__init__.py
CHANGED
noticecard/app.py
CHANGED
|
@@ -81,7 +81,7 @@ def create_app(db_path: str) -> FastAPI:
|
|
|
81
81
|
},
|
|
82
82
|
"serverInfo": {
|
|
83
83
|
"name": "noticecard",
|
|
84
|
-
"version": "0.
|
|
84
|
+
"version": "0.2.0"
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -100,8 +100,7 @@ def create_app(db_path: str) -> FastAPI:
|
|
|
100
100
|
"type": "object",
|
|
101
101
|
"properties": {
|
|
102
102
|
"title": {"type": "string", "description": "卡片标题"},
|
|
103
|
-
"
|
|
104
|
-
"desc2": {"type": "string", "description": "描述2(可选)"}
|
|
103
|
+
"description": {"type": "string", "description": "卡片描述(可选)"}
|
|
105
104
|
},
|
|
106
105
|
"required": ["title"]
|
|
107
106
|
}
|
|
@@ -136,8 +135,7 @@ def create_app(db_path: str) -> FastAPI:
|
|
|
136
135
|
"properties": {
|
|
137
136
|
"card_id": {"type": "number", "description": "卡片ID"},
|
|
138
137
|
"title": {"type": "string", "description": "新标题(可选)"},
|
|
139
|
-
"
|
|
140
|
-
"desc2": {"type": "string", "description": "新描述2(可选)"}
|
|
138
|
+
"description": {"type": "string", "description": "新描述(可选)"}
|
|
141
139
|
},
|
|
142
140
|
"required": ["card_id"]
|
|
143
141
|
}
|
|
@@ -175,7 +173,7 @@ def create_app(db_path: str) -> FastAPI:
|
|
|
175
173
|
"result": {
|
|
176
174
|
"content": [{
|
|
177
175
|
"type": "text",
|
|
178
|
-
"text": f"✅ 创建成功!\nID: {card.id}\n标题: {card.title}\n
|
|
176
|
+
"text": f"✅ 创建成功!\nID: {card.id}\n标题: {card.title}\n描述: {card.description or '无'}"
|
|
179
177
|
}]
|
|
180
178
|
}
|
|
181
179
|
}
|
|
@@ -217,7 +215,7 @@ def create_app(db_path: str) -> FastAPI:
|
|
|
217
215
|
"result": {
|
|
218
216
|
"content": [{
|
|
219
217
|
"type": "text",
|
|
220
|
-
"text": f"📄 卡片详情\n\nID: {card.id}\n标题: {card.title}\n
|
|
218
|
+
"text": f"📄 卡片详情\n\nID: {card.id}\n标题: {card.title}\n描述: {card.description or '无'}\n创建时间: {card.created_at}\n更新时间: {card.updated_at}"
|
|
221
219
|
}]
|
|
222
220
|
}
|
|
223
221
|
}
|
noticecard/cli.py
CHANGED
noticecard/models.py
CHANGED
|
@@ -17,8 +17,7 @@ class Card(Base):
|
|
|
17
17
|
|
|
18
18
|
id = Column(Integer, primary_key=True, index=True, autoincrement=True)
|
|
19
19
|
title = Column(String, nullable=False, index=True)
|
|
20
|
-
|
|
21
|
-
desc2 = Column(String, nullable=True)
|
|
20
|
+
description = Column(String, nullable=True)
|
|
22
21
|
created_at = Column(DateTime, default=lambda: datetime.now(timezone.utc), nullable=False)
|
|
23
22
|
updated_at = Column(DateTime, default=lambda: datetime.now(timezone.utc), nullable=False)
|
|
24
23
|
|
noticecard/schemas.py
CHANGED
|
@@ -8,8 +8,7 @@ from pydantic import BaseModel, Field
|
|
|
8
8
|
class CardBase(BaseModel):
|
|
9
9
|
"""Base card schema."""
|
|
10
10
|
title: str = Field(..., min_length=1, max_length=200, description="Card title")
|
|
11
|
-
|
|
12
|
-
desc2: Optional[str] = Field(None, max_length=500, description="Second description")
|
|
11
|
+
description: Optional[str] = Field(None, max_length=1000, description="Card description")
|
|
13
12
|
|
|
14
13
|
|
|
15
14
|
class CardCreate(CardBase):
|
|
@@ -20,8 +19,7 @@ class CardCreate(CardBase):
|
|
|
20
19
|
"examples": [
|
|
21
20
|
{
|
|
22
21
|
"title": "会议通知",
|
|
23
|
-
"
|
|
24
|
-
"desc2": "一号会议室"
|
|
22
|
+
"description": "明天下午2点在一号会议室"
|
|
25
23
|
}
|
|
26
24
|
]
|
|
27
25
|
}
|
|
@@ -31,15 +29,14 @@ class CardCreate(CardBase):
|
|
|
31
29
|
class CardUpdate(BaseModel):
|
|
32
30
|
"""Schema for updating an existing card."""
|
|
33
31
|
title: Optional[str] = Field(None, min_length=1, max_length=200, description="Card title")
|
|
34
|
-
|
|
35
|
-
desc2: Optional[str] = Field(None, max_length=500, description="Second description")
|
|
32
|
+
description: Optional[str] = Field(None, max_length=1000, description="Card description")
|
|
36
33
|
|
|
37
34
|
model_config = {
|
|
38
35
|
"json_schema_extra": {
|
|
39
36
|
"examples": [
|
|
40
37
|
{
|
|
41
38
|
"title": "更新后的标题",
|
|
42
|
-
"
|
|
39
|
+
"description": "更新后的描述"
|
|
43
40
|
}
|
|
44
41
|
]
|
|
45
42
|
}
|
noticecard/templates.py
CHANGED
|
@@ -193,14 +193,9 @@ def get_index_html() -> str:
|
|
|
193
193
|
<small id="titleHint" class="form-hint">必填,最多200字符</small>
|
|
194
194
|
</div>
|
|
195
195
|
<div class="mb-3">
|
|
196
|
-
<label for="
|
|
197
|
-
<textarea class="form-control" id="
|
|
198
|
-
<small id="
|
|
199
|
-
</div>
|
|
200
|
-
<div class="mb-3">
|
|
201
|
-
<label for="desc2" class="form-label">描述2</label>
|
|
202
|
-
<textarea class="form-control" id="desc2" name="desc2" rows="2" maxlength="500" aria-describedby="desc2Hint"></textarea>
|
|
203
|
-
<small id="desc2Hint" class="form-hint">可选,最多500字符</small>
|
|
196
|
+
<label for="description" class="form-label">描述</label>
|
|
197
|
+
<textarea class="form-control" id="description" name="description" rows="4" maxlength="1000" aria-describedby="descriptionHint"></textarea>
|
|
198
|
+
<small id="descriptionHint" class="form-hint">可选,最多1000字符</small>
|
|
204
199
|
</div>
|
|
205
200
|
</form>
|
|
206
201
|
</div>
|
|
@@ -260,8 +255,7 @@ def get_index_html() -> str:
|
|
|
260
255
|
<article class="notice-card" data-card-id="${card.id}" role="listitem">
|
|
261
256
|
<div class="card-body">
|
|
262
257
|
<h3 class="card-title heading">${escapeHtml(card.title)}</h3>
|
|
263
|
-
${card.
|
|
264
|
-
${card.desc2 ? `<p class="text-muted mb-0">${escapeHtml(card.desc2)}</p>` : ''}
|
|
258
|
+
${card.description ? `<p class="text-muted mb-0">${escapeHtml(card.description)}</p>` : ''}
|
|
265
259
|
</div>
|
|
266
260
|
<div class="card-footer">
|
|
267
261
|
<div class="d-flex justify-content-between align-items-center">
|
|
@@ -308,8 +302,7 @@ def get_index_html() -> str:
|
|
|
308
302
|
document.getElementById('modalTitle').textContent = '编辑卡片';
|
|
309
303
|
document.getElementById('cardId').value = card.id;
|
|
310
304
|
document.getElementById('title').value = card.title;
|
|
311
|
-
document.getElementById('
|
|
312
|
-
document.getElementById('desc2').value = card.desc2 || '';
|
|
305
|
+
document.getElementById('description').value = card.description || '';
|
|
313
306
|
|
|
314
307
|
modal.show();
|
|
315
308
|
} catch (error) {
|
|
@@ -329,8 +322,7 @@ def get_index_html() -> str:
|
|
|
329
322
|
const id = document.getElementById('cardId').value;
|
|
330
323
|
const data = {
|
|
331
324
|
title: document.getElementById('title').value.trim(),
|
|
332
|
-
|
|
333
|
-
desc2: document.getElementById('desc2').value.trim() || null
|
|
325
|
+
description: document.getElementById('description').value.trim() || null
|
|
334
326
|
};
|
|
335
327
|
|
|
336
328
|
const spinner = document.getElementById('saveSpinner');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: noticecard
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: NoticeCard server with RESTful API and web UI
|
|
5
5
|
Author: NoticeCard Team
|
|
6
6
|
License: MIT
|
|
@@ -115,8 +115,7 @@ curl -X POST "http://localhost:3143/cards/" \
|
|
|
115
115
|
-H "Content-Type: application/json" \
|
|
116
116
|
-d '{
|
|
117
117
|
"title": "会议通知",
|
|
118
|
-
"
|
|
119
|
-
"desc2": "一号会议室"
|
|
118
|
+
"description": "明天下午2点在一号会议室"
|
|
120
119
|
}'
|
|
121
120
|
```
|
|
122
121
|
|
|
@@ -136,8 +135,7 @@ curl "http://localhost:3143/cards/?skip=0&limit=10"
|
|
|
136
135
|
|------|------|------|
|
|
137
136
|
| id | Integer | 主键,自动生成 |
|
|
138
137
|
| title | String | 标题(必填) |
|
|
139
|
-
|
|
|
140
|
-
| desc2 | String | 描述2(可选) |
|
|
138
|
+
| description | String | 描述(可选) |
|
|
141
139
|
| created_at | DateTime | 创建时间 |
|
|
142
140
|
| updated_at | DateTime | 更新时间 |
|
|
143
141
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
noticecard/__init__.py,sha256=PFY9KDi_UH6KUAAuZbDXq44gDZPqIrWV2cyYn2BoM-o,92
|
|
2
|
+
noticecard/app.py,sha256=_poOGqlaFC3DF7lcisOoXxT_Xh0ZLE960v1kAGuDDzE,18617
|
|
3
|
+
noticecard/cli.py,sha256=GToKNEStIEPLkgiWB61Q8Ro-U1_rVWds3bcoyPf8dCQ,2556
|
|
4
|
+
noticecard/models.py,sha256=P6eirD7tVwOjAatA5MOZHDnjPr4-GJ_5zYCPMp0tFZs,1475
|
|
5
|
+
noticecard/schemas.py,sha256=FMEKNcnMR078F9T2hgEsygOVQgyJykHPRhlN_WSGU5A,1491
|
|
6
|
+
noticecard/templates.py,sha256=TCOr9Jv44I45GmrEPwQ_2JWRdXZNL-nRS6FKkU-65z4,19162
|
|
7
|
+
noticecard-0.2.0.dist-info/METADATA,sha256=6iqnC1thb3hQZPUP_PxbIsnYmNHXxw_Ndf27ys9vsqk,5553
|
|
8
|
+
noticecard-0.2.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
9
|
+
noticecard-0.2.0.dist-info/entry_points.txt,sha256=j-F8uQSatTV2uyMh0JM3iXjTX2PiTIHX5FozbGy-u1A,46
|
|
10
|
+
noticecard-0.2.0.dist-info/top_level.txt,sha256=WvuJAJMD8eTfRfGdeMAzSLXiv8UYjlfUBa5mw9g7Mqg,11
|
|
11
|
+
noticecard-0.2.0.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
noticecard/__init__.py,sha256=UC1UfxkAo2--veC7cav9Udf2fSk8_ZMty0wcr-g3EXc,92
|
|
2
|
-
noticecard/app.py,sha256=CWNRM-I7D-OiY5uKU2jyBIo_KR6NdjPnpy0-LfPu3mM,18882
|
|
3
|
-
noticecard/cli.py,sha256=xxikKsKvFeL8lssC5j24wwi3lbJOjnm6syz0gQVnGK4,2556
|
|
4
|
-
noticecard/models.py,sha256=B4XY9xLkI7JYSQwF1y7rYMZfbNsd7hprZ7bm6-ohWks,1512
|
|
5
|
-
noticecard/schemas.py,sha256=70Wn_1NGMxFL-34DnmSNr7_grYBNiHzuAMxCJYF6kkQ,1675
|
|
6
|
-
noticecard/templates.py,sha256=IihqLS823JXGcCKHRkxiAcsMqn5L94x_Bs3M9i-HMNE,19766
|
|
7
|
-
noticecard-0.1.0.dist-info/METADATA,sha256=sA8kqjey-1hYPAWahyAb7Qw2iOAjw4JwONjh7-YqyQg,5595
|
|
8
|
-
noticecard-0.1.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
9
|
-
noticecard-0.1.0.dist-info/entry_points.txt,sha256=j-F8uQSatTV2uyMh0JM3iXjTX2PiTIHX5FozbGy-u1A,46
|
|
10
|
-
noticecard-0.1.0.dist-info/top_level.txt,sha256=WvuJAJMD8eTfRfGdeMAzSLXiv8UYjlfUBa5mw9g7Mqg,11
|
|
11
|
-
noticecard-0.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|