|
@@ -2,6 +2,9 @@ from fastapi import APIRouter
|
|
|
from loguru import logger
|
|
|
|
|
|
from app.controllers.algorithms.graph_coloring import get_graph_coloring
|
|
|
+from app.controllers.algorithms.meeting_attendee_recommendation import (
|
|
|
+ build_recommendations,
|
|
|
+)
|
|
|
from app.models.domain.algorithms import GraphColoringRequest, GraphColoringResponse
|
|
|
from app.models.domain.algorithms import (
|
|
|
AttendeesRecommendationRequest,
|
|
@@ -29,4 +32,11 @@ async def get_graph_coloring_result(graph: GraphColoringRequest):
|
|
|
"/attendees-recommendation", response_model=AttendeesRecommendationResponse
|
|
|
)
|
|
|
async def get_recommended(meeting_info: AttendeesRecommendationRequest):
|
|
|
- return {"code": 200, "message": "Test", "data": {"userIdList": []}}
|
|
|
+ try:
|
|
|
+ res = await build_recommendations(
|
|
|
+ meeting_info.companyId, meeting_info.initiatorId
|
|
|
+ )
|
|
|
+ except [KeyError, IndexError, ValueError]:
|
|
|
+ return {"code": 500, "message": "Recommend failure."}
|
|
|
+ else:
|
|
|
+ return {"code": 200, "message": "sucess", "data": {"userIdList": res}}
|