diff --git a/apps/pre-processing-service/app/api/endpoints/blog.py b/apps/pre-processing-service/app/api/endpoints/blog.py index 04ae0b14..138fb706 100644 --- a/apps/pre-processing-service/app/api/endpoints/blog.py +++ b/apps/pre-processing-service/app/api/endpoints/blog.py @@ -9,11 +9,6 @@ router = APIRouter() -@router.get("/", summary="블로그 API 상태 확인") -async def root(): - return {"message": "blog API"} - - @router.post( "/rag/create", response_model=ResponseBlogCreate, @@ -49,9 +44,7 @@ async def publish(request: RequestBlogPublish): raise CustomException( "네이버 블로그 포스팅에 실패했습니다.", status_code=500 ) - return ResponseBlogPublish( - job_id=1, schedule_id=1, schedule_his_id=1, status="200", metadata=result - ) + return ResponseBlogPublish(status="success", metadata=result) elif request.tag == "tistory": tistory_service = TistoryBlogPostService() @@ -66,9 +59,7 @@ async def publish(request: RequestBlogPublish): "티스토리 블로그 포스팅에 실패했습니다.", status_code=500 ) - return ResponseBlogPublish( - job_id=1, schedule_id=1, schedule_his_id=1, status="200", metadata=result - ) + return ResponseBlogPublish(status="success", metadata=result) elif request.tag == "blogger": blogger_service = BloggerBlogPostService() @@ -83,6 +74,4 @@ async def publish(request: RequestBlogPublish): "블로거 블로그 포스팅에 실패했습니다.", status_code=500 ) - return ResponseBlogPublish( - job_id=1, schedule_id=1, schedule_his_id=1, status="200", metadata=result - ) + return ResponseBlogPublish(status="success", metadata=result) diff --git a/apps/pre-processing-service/app/api/endpoints/keywords.py b/apps/pre-processing-service/app/api/endpoints/keywords.py index 2b407d6d..92c8a66b 100644 --- a/apps/pre-processing-service/app/api/endpoints/keywords.py +++ b/apps/pre-processing-service/app/api/endpoints/keywords.py @@ -6,14 +6,6 @@ router = APIRouter() -@router.get("/", summary="키워드 API 상태 확인") -async def root(): - """ - 키워드 API가 정상 동작하는지 확인 - """ - return {"message": "keyword API"} - - @router.post( "/search", response_model=ResponseNaverSearch, summary="네이버 키워드 검색" ) diff --git a/apps/pre-processing-service/app/api/endpoints/product.py b/apps/pre-processing-service/app/api/endpoints/product.py index ceb55c9d..95b983e4 100644 --- a/apps/pre-processing-service/app/api/endpoints/product.py +++ b/apps/pre-processing-service/app/api/endpoints/product.py @@ -16,14 +16,6 @@ router = APIRouter() -@router.get("/", summary="상품 API 상태 확인") -async def root(): - """ - 상품 API 서버 상태 확인용 엔드포인트 - """ - return {"message": "product API"} - - @router.post("/search", response_model=ResponseSadaguSearch, summary="상품 검색") async def search(request: RequestSadaguSearch): """ diff --git a/apps/pre-processing-service/app/api/endpoints/test.py b/apps/pre-processing-service/app/api/endpoints/test.py index e26bd203..9e17a7c4 100644 --- a/apps/pre-processing-service/app/api/endpoints/test.py +++ b/apps/pre-processing-service/app/api/endpoints/test.py @@ -21,11 +21,6 @@ router = APIRouter() -@router.get("/") -async def root(): - return {"message": "테스트 API"} - - @router.get("/hello/{name}", tags=["hello"]) # @log_api_call async def say_hello(name: str): diff --git a/apps/pre-processing-service/app/model/schemas.py b/apps/pre-processing-service/app/model/schemas.py index 61720cb6..52775416 100644 --- a/apps/pre-processing-service/app/model/schemas.py +++ b/apps/pre-processing-service/app/model/schemas.py @@ -5,29 +5,31 @@ # 기본 요청 class RequestBase(BaseModel): - job_id: int = Field( - ..., title="작업 ID", description="현재 실행 중인 작업의 고유 식별자" - ) - schedule_id: int = Field( - ..., title="스케줄 ID", description="예약된 스케줄의 고유 식별자" - ) - schedule_his_id: Optional[int] = Field( - None, title="스케줄 히스토리 ID", description="스케줄 실행 이력의 고유 식별자" - ) + # job_id: int = Field( + # ..., title="작업 ID", description="현재 실행 중인 작업의 고유 식별자" + # ) + # schedule_id: int = Field( + # ..., title="스케줄 ID", description="예약된 스케줄의 고유 식별자" + # ) + # schedule_his_id: Optional[int] = Field( + # None, title="스케줄 히스토리 ID", description="스케줄 실행 이력의 고유 식별자" + # ) + pass # 기본 응답 class ResponseBase(BaseModel): - job_id: int = Field( - ..., title="작업 ID", description="현재 실행 중인 작업의 고유 식별자" - ) - schedule_id: int = Field( - ..., title="스케줄 ID", description="예약된 스케줄의 고유 식별자" - ) - schedule_his_id: Optional[int] = Field( - None, title="스케줄 히스토리 ID", description="스케줄 실행 이력의 고유 식별자" - ) + # job_id: int = Field( + # ..., title="작업 ID", description="현재 실행 중인 작업의 고유 식별자" + # ) + # schedule_id: int = Field( + # ..., title="스케줄 ID", description="예약된 스케줄의 고유 식별자" + # ) + # schedule_his_id: Optional[int] = Field( + # None, title="스케줄 히스토리 ID", description="스케줄 실행 이력의 고유 식별자" + # ) status: str = Field(..., title="상태", description="요청 처리 상태") + pass # 네이버 키워드 추출 diff --git a/apps/pre-processing-service/app/service/match_service.py b/apps/pre-processing-service/app/service/match_service.py index 5816957a..9f340683 100644 --- a/apps/pre-processing-service/app/service/match_service.py +++ b/apps/pre-processing-service/app/service/match_service.py @@ -16,15 +16,16 @@ def match_products(self, request: RequestSadaguMatch) -> dict: products = request.search_results logger.info( - f"키워드 매칭 서비스 시작: job_id={request.job_id}, schedule_id={request.schedule_id}, keyword='{keyword}', products_count={len(products) if products else 0}" + # f"키워드 매칭 서비스 시작: job_id={request.job_id}, schedule_id={request.schedule_id}, keyword='{keyword}', products_count={len(products) if products else 0}" + f"keyword='{keyword}'" ) if not products: logger.warning(f"매칭할 상품이 없음: keyword='{keyword}'") return { - "job_id": request.job_id, - "schedule_id": request.schedule_id, - "schedule_his_id": request.schedule_his_id, + # "job_id": request.job_id, + # "schedule_id": request.schedule_id, + # "schedule_his_id": request.schedule_his_id, "keyword": keyword, "matched_products": [], "status": "success", @@ -80,9 +81,9 @@ def match_products(self, request: RequestSadaguMatch) -> dict: ) return { - "job_id": request.job_id, - "schedule_id": request.schedule_id, - "schedule_his_id": request.schedule_his_id, + # "job_id": request.job_id, + # "schedule_id": request.schedule_id, + # "schedule_his_id": request.schedule_his_id, "keyword": keyword, "matched_products": matched_products, "status": "success", @@ -90,6 +91,6 @@ def match_products(self, request: RequestSadaguMatch) -> dict: except Exception as e: logger.error( - f"매칭 서비스 오류: job_id={request.job_id}, keyword='{keyword}', error='{e}'" + # f"매칭 서비스 오류: job_id={request.job_id}, keyword='{keyword}', error='{e}'" ) raise InvalidItemDataException() diff --git a/apps/pre-processing-service/app/service/search_service.py b/apps/pre-processing-service/app/service/search_service.py index 6fb09c0f..4cb1bf99 100644 --- a/apps/pre-processing-service/app/service/search_service.py +++ b/apps/pre-processing-service/app/service/search_service.py @@ -17,7 +17,8 @@ async def search_products(self, request: RequestSadaguSearch) -> dict: try: logger.info( - f"상품 검색 서비스 시작: job_id={request.job_id}, schedule_id={request.schedule_id}, keyword='{keyword}'" + # f"상품 검색 서비스 시작: job_id={request.job_id}, schedule_id={request.schedule_id}, keyword='{keyword}'" + f"keyword='{keyword}'" ) # Selenium 또는 httpx로 상품 검색 @@ -29,9 +30,9 @@ async def search_products(self, request: RequestSadaguSearch) -> dict: if not search_results: logger.warning(f"검색 결과가 없습니다: keyword='{keyword}'") return { - "job_id": request.job_id, - "schedule_id": request.schedule_id, - "schedule_his_id": request.schedule_his_id, + # "job_id": request.job_id, + # "schedule_id": request.schedule_id, + # "schedule_his_id": request.schedule_his_id, "keyword": keyword, "search_results": [], "status": "success", @@ -90,9 +91,9 @@ async def search_products(self, request: RequestSadaguSearch) -> dict: ) return { - "job_id": request.job_id, - "schedule_id": request.schedule_id, - "schedule_his_id": request.schedule_his_id, + # "job_id": request.job_id, + # "schedule_id": request.schedule_id, + # "schedule_his_id": request.schedule_his_id, "keyword": keyword, "search_results": enriched_results, "status": "success",