Remove obsolete endpoints (#89)
Remove endpoints api/login/token and api/login/profile --------- Co-authored-by: Thomas Peetz <thomas.peetz@cimt-ag.de> Reviewed-on: #89
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
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
|
||||
@@ -1,5 +1,38 @@
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from src.db.models.media import MediaVideo
|
||||
|
||||
class MediaVideoResponse(BaseModel):
|
||||
id: str
|
||||
created_date: datetime
|
||||
last_modified_date: datetime
|
||||
version: int
|
||||
cloud_link: Optional[str] = None
|
||||
file_name: Optional[str] = None
|
||||
path: Optional[str] = None
|
||||
review: bool = False
|
||||
title: Optional[str] = None
|
||||
url: Optional[str] = None
|
||||
should_download: bool = False
|
||||
|
||||
class AddLink(BaseModel):
|
||||
url: str
|
||||
|
||||
def to_response(video: MediaVideo) -> MediaVideoResponse:
|
||||
response: MediaVideoResponse = MediaVideoResponse(
|
||||
id=video.id,
|
||||
created_date=video.created_date,
|
||||
last_modified_date=video.last_modified_date,
|
||||
version=video.version,
|
||||
cloud_link=video.cloud_link,
|
||||
file_name=video.file_name,
|
||||
path=video.path,
|
||||
review=video.review,
|
||||
title=video.title,
|
||||
url=video.url,
|
||||
should_download=video.should_download
|
||||
)
|
||||
return response
|
||||
|
||||
Reference in New Issue
Block a user