新增征信员工HTML样本并改造Mock解析
This commit is contained in:
@@ -3,11 +3,13 @@ from typing import Optional
|
||||
from fastapi import APIRouter, File, Form, UploadFile
|
||||
|
||||
from services.credit_debug_service import CreditDebugService
|
||||
from services.credit_html_identity_service import CreditHtmlIdentityService
|
||||
from services.credit_payload_service import CreditPayloadService
|
||||
|
||||
router = APIRouter()
|
||||
payload_service = CreditPayloadService("config/credit_feature_schema.json")
|
||||
debug_service = CreditDebugService("config/credit_response_examples.json")
|
||||
identity_service = CreditHtmlIdentityService()
|
||||
|
||||
|
||||
@router.post("/xfeature-mngs/conversation/htmlEval")
|
||||
@@ -24,10 +26,13 @@ async def html_eval(
|
||||
if error_response:
|
||||
return error_response
|
||||
|
||||
html_content = await file.read()
|
||||
subject_identity = identity_service.extract_identity(html_content)
|
||||
payload = payload_service.generate_payload(
|
||||
model=model,
|
||||
h_type=hType,
|
||||
filename=file.filename or "credit.html",
|
||||
subject_identity=subject_identity,
|
||||
)
|
||||
return debug_service.build_success_response(payload)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user