6077f685e0
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
Remove endpoints api/login/token and api/login/profile --------- Co-authored-by: Thomas Peetz <thomas.peetz@cimt-ag.de> Reviewed-on: #89
31 lines
765 B
Python
31 lines
765 B
Python
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel
|
|
|
|
from src.db.models.media import MediaArticle
|
|
|
|
class MediaArticleResponse(BaseModel):
|
|
id: str
|
|
created_date: datetime
|
|
last_modified_date: datetime
|
|
version: int
|
|
review: bool = False
|
|
title: Optional[str] = None
|
|
url: Optional[str] = None
|
|
|
|
class AddLink(BaseModel):
|
|
url: str
|
|
|
|
def to_response(video: MediaArticle) -> MediaArticleResponse:
|
|
response: MediaArticleResponse = MediaArticleResponse(
|
|
id=video.id,
|
|
created_date=video.created_date,
|
|
last_modified_date=video.last_modified_date,
|
|
version=video.version,
|
|
review=video.review,
|
|
title=video.title,
|
|
url=video.url,
|
|
)
|
|
return response
|