You've already forked RekomenciBackend
@@ -8,6 +8,7 @@ from template_project.application.resume.entity import (
|
||||
ResumeId,
|
||||
ResumePrediction,
|
||||
)
|
||||
from template_project.application.user.entity import UserId
|
||||
|
||||
|
||||
class ResumeDataGateway(Protocol):
|
||||
@@ -19,6 +20,10 @@ class ResumeDataGateway(Protocol):
|
||||
async def load(self, resume_id: ResumeId) -> Resume:
|
||||
raise NotImplementedError
|
||||
|
||||
@abstractmethod
|
||||
async def list_by_user_id(self, user_id: UserId, limit: int, offset: int) -> Sequence[Resume]:
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
class ResumePredictionDataGateway(Protocol):
|
||||
@abstractmethod
|
||||
|
||||
@@ -61,3 +61,32 @@ class GetResumeInteractor:
|
||||
experience_type=resume.experience_type,
|
||||
prediction=prediction,
|
||||
)
|
||||
|
||||
|
||||
@to_data_structure
|
||||
class ResumeListItemResponse:
|
||||
position: str
|
||||
about_me: str
|
||||
key_skills: list[str]
|
||||
experience_type: ExperienceType
|
||||
|
||||
|
||||
@to_interactor
|
||||
class GetResumeListInteractor:
|
||||
identity_provider: IdentityProvider
|
||||
resume_data_gateway: ResumeDataGateway
|
||||
|
||||
async def execute(self, limit: int, offset: int) -> list[ResumeListItemResponse]:
|
||||
user = await self.identity_provider.get_current_user()
|
||||
|
||||
resumes = await self.resume_data_gateway.list_by_user_id(user.id, limit=limit, offset=offset)
|
||||
|
||||
return [
|
||||
ResumeListItemResponse(
|
||||
position=r.position,
|
||||
about_me=r.about_me,
|
||||
key_skills=r.key_skills,
|
||||
experience_type=r.experience_type,
|
||||
)
|
||||
for r in resumes
|
||||
]
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ def suitable_resumes_key(
|
||||
return wrapper
|
||||
|
||||
|
||||
class ResumeEmbeddingPipline:
|
||||
class ResumeEmbeddingPipeline:
|
||||
def __init__(
|
||||
self,
|
||||
unit_of_work: UnitOfWork,
|
||||
Reference in New Issue
Block a user