Remove obsolete endpoints (#89)
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
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
This commit was merged in pull request #89.
This commit is contained in:
@@ -1,8 +1,38 @@
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from src.db.models.comic import Issue
|
||||
|
||||
|
||||
class IssueResponse(BaseModel):
|
||||
id: str
|
||||
created_date: datetime
|
||||
last_modified_date: datetime
|
||||
version: int
|
||||
issue_number: str
|
||||
title: Optional[str]
|
||||
published_on: Optional[datetime]
|
||||
in_stock: bool
|
||||
is_read: bool
|
||||
comic_id: str
|
||||
volume_id: Optional[str]
|
||||
story_arc_id: Optional[str]
|
||||
|
||||
def to_response(issue: Issue) -> IssueResponse:
|
||||
response: IssueResponse = IssueResponse(
|
||||
id=issue.id,
|
||||
created_date=issue.created_date,
|
||||
last_modified_date=issue.last_modified_date,
|
||||
version=issue.version,
|
||||
issue_number=issue.issue_number,
|
||||
title=issue.title,
|
||||
published_on=issue.published_on,
|
||||
in_stock=issue.in_stock,
|
||||
is_read=issue.is_read,
|
||||
comic_id=issue.comic_id,
|
||||
volume_id=issue.volume_id,
|
||||
story_arc_id=issue.story_arc_id
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -11,3 +11,4 @@ class IssueDetailsResponse(BaseModel):
|
||||
is_read: bool
|
||||
comic: ComicResponse
|
||||
volume: VolumeResponse | None
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from src.db.models.comic import StoryArc
|
||||
|
||||
class StoryArcResponse(BaseModel):
|
||||
id: str
|
||||
created_date: datetime
|
||||
last_modified_date: datetime
|
||||
version: int
|
||||
name: str
|
||||
comic_id: str
|
||||
volume_id: Optional[str]
|
||||
|
||||
class AddLink(BaseModel):
|
||||
url: str
|
||||
|
||||
def to_response(storyarc: StoryArc) -> StoryArcResponse:
|
||||
response: StoryArcResponse = StoryArcResponse(
|
||||
id=storyarc.id,
|
||||
created_date=storyarc.created_date,
|
||||
last_modified_date=storyarc.last_modified_date,
|
||||
version=storyarc.version,
|
||||
name=storyarc.name,
|
||||
comic_id=storyarc.comic_id,
|
||||
volume_id=storyarc.volume_id
|
||||
)
|
||||
return response
|
||||
@@ -1,6 +1,25 @@
|
||||
from datetime import datetime
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from src.db.models.comic import Volume
|
||||
|
||||
|
||||
class VolumeResponse(BaseModel):
|
||||
id: str
|
||||
created_date: datetime
|
||||
last_modified_date: datetime
|
||||
version: int
|
||||
name: str
|
||||
comic_id: str
|
||||
|
||||
def to_response(volume: Volume) -> VolumeResponse:
|
||||
response: VolumeResponse = VolumeResponse(
|
||||
id=volume.id,
|
||||
created_date=volume.created_date,
|
||||
last_modified_date=volume.last_modified_date,
|
||||
version=volume.version,
|
||||
name=volume.name,
|
||||
comic_id=volume.comic_id
|
||||
)
|
||||
return response
|
||||
|
||||
@@ -1,9 +1,26 @@
|
||||
from datetime import datetime
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from src.db.models.comic import WorkType
|
||||
|
||||
class AddWorkType(BaseModel):
|
||||
worktype: str
|
||||
|
||||
class WorktypeResponse(BaseModel):
|
||||
id: str
|
||||
created_date: datetime
|
||||
last_modified_date: datetime
|
||||
version: int
|
||||
name: str
|
||||
|
||||
|
||||
def to_response(worktype: WorkType) -> WorktypeResponse:
|
||||
response: WorktypeResponse = WorktypeResponse(
|
||||
id=worktype.id,
|
||||
created_date=worktype.created_date,
|
||||
last_modified_date=worktype.last_modified_date,
|
||||
version=worktype.version,
|
||||
name=worktype.name
|
||||
)
|
||||
return response
|
||||
|
||||
Reference in New Issue
Block a user