feat: public text items, wall, and detail API

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
肉末
2026-07-14 12:43:53 +08:00
parent 4d3cd2ac8b
commit 0e59936e34
8 changed files with 324 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
from datetime import datetime
from typing import Literal
from pydantic import BaseModel, Field
TTLOption = Literal["1h", "24h", "7d", "never"]
class ItemCreate(BaseModel):
body: str = Field(min_length=1)
title: str | None = None
is_public: bool = True
burn_after_read: bool = False
ttl: TTLOption = "24h"
class ItemOut(BaseModel):
slug: str
kind: str
title: str
body: str | None = None
file_name: str | None = None
mime: str | None = None
size_bytes: int | None = None
is_public: bool
burn_after_read: bool
expires_at: datetime | None
created_at: datetime
view_count: int
model_config = {"from_attributes": True}
class WallResponse(BaseModel):
items: list[ItemOut]
page: int
page_size: int
total: int