简历提取,写入

This commit is contained in:
yujj128
2025-12-06 17:04:05 +08:00
parent ec0995d08a
commit 16583dbb06
2 changed files with 5 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ import pathlib
from decouple import config
# BASE_PATH = config('BASE_PATH', default='E://pyptoject//yj_resume//')
BASE_PATH = config('BASE_PATH', default='D://PycharmProject//yj_resume//')
BASE_PATH = config('BASE_PATH', default='D://PycharmProject//yj_resume//uploads//')
# 导出数据到excel

View File

@@ -16,7 +16,7 @@ import logging
from service.parse_resume2_doc import extra_resume
logger = logging.getLogger(__name__)
BASE_PATH = config('BASE_PATH', default='D://PycharmProject//yj_resume//')
BASE_PATH = config('BASE_PATH', default='D://PycharmProject//yj_resume//uploads//')
@@ -25,6 +25,7 @@ def check_and_create_directory(files):
logger.info("check_and_create_directory in service")
# 先创建一个task
if not files or len(files) == 0:
logger.warning("check_and_create_directory is empty")
return None
id = str(uuid.uuid4())
current_time = datetime.now()
@@ -68,7 +69,7 @@ async def upload_and_save_file(dir_id, files: List[UploadFile]) -> (bool, str):
except Exception as e:
print(f"Failed to save DBRESUME error {e}")
session.rollback()
return False, f"Failed to save DBRESUME error {e}",[]
return False, f"Failed to save DBRESUME error {e}"
finally:
session.close()
return True, "success"
@@ -78,7 +79,7 @@ async def fetch_files(dir_id) -> (bool, str):
logger.info(f"start fetching files task {dir_id} in service")
if not os.path.exists(BASE_PATH):
logger.info(f"目录{BASE_PATH}不存在")
return None
return False, f"Failed to fetch file 目录{BASE_PATH}不存在"
file_extensions = ['.docx', '.doc']
files_list = []
dir_path = pathlib.Path(BASE_PATH).joinpath(dir_id)