diff --git a/api/api_v1/endpoints/interview.py b/api/api_v1/endpoints/interview.py index 06a9227..9ddbdae 100644 --- a/api/api_v1/endpoints/interview.py +++ b/api/api_v1/endpoints/interview.py @@ -372,7 +372,6 @@ async def interview_file_insert( try: res = obsClient.getObject('legu-cdn-source', data_in.filenames, path_data + '/' + filename) if res.status < 300: - data = get_resume(filename, path_data) education = data['education'] # 学历int转化 @@ -487,6 +486,7 @@ async def interview_file_insert( 'language_list': language_list, 'remembrance_list': remembrance_list } + return schemas.Msg(code=200, msg='ok', data=res_data) else: return schemas.Msg(code=-9, msg='解析失败', data='') diff --git a/utils/jianli.py b/utils/jianli.py index 133a5c1..95bb5c6 100644 --- a/utils/jianli.py +++ b/utils/jianli.py @@ -102,20 +102,33 @@ def chkworlkandtime(listdata): res.update({key: trueList}) ress = [] if res != {}: + print(res) for i in range(len(res['公司名'])): company_name = '' position_name = '' duty = '' if '公司名' in res: - company_name = res['公司名'][i]['text'] + if len(res['公司名']) >= i + 1: + company_name = res['公司名'][i]['text'] + else: + company_name = '' if '职责' in res: - position_name = res['职责'][i]['text'] + if len(res['职责']) >= i + 1: + position_name = res['职责'][i]['text'] + else: + position_name = '' if '工作内容' in res: - duty = res['工作内容'][i]['text'] + if len(res['工作内容']) >= i + 1: + duty = res['工作内容'][i]['text'] + else: + duty = '' if '岗位' in res: - duty = res['工作内容'][i]['text'] + if len(res['岗位']) >= i + 1: + duty = res['岗位'][i]['text'] + else: + duty = '' date = { - 'company_name ': company_name, + 'company_name': company_name, 'position_name': position_name, 'duty': duty }