|
@@ -39,6 +39,9 @@ public class TenResumeServiceImpl implements TenResumeService {
|
|
|
@Value("${ten.resume.secretkey:HlKf8e7sDtBbm1Am05r0628y2SUYC5LxEz57odxY}")
|
|
|
private String tenResumeSecretKey;
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@Value("${ten.resume.url:https://service-9wsy8usn-1302482110.bj.apigw.tencentcs.com/release/ResumeParser}")
|
|
|
private String resumeReqUrl;
|
|
|
|
|
@@ -46,15 +49,18 @@ public class TenResumeServiceImpl implements TenResumeService {
|
|
|
@Override
|
|
|
public CommonResult<TemResumeResVo> tenResumeService(String fileName, String fileContent) {
|
|
|
try {
|
|
|
+ // TODO 此处后续优化缓存功能,减少API调用次数
|
|
|
TemResumeResVo resume = resume(fileName, fileContent, 1, 1, 1);
|
|
|
return CommonResult.success(resume);
|
|
|
}catch (Exception e){
|
|
|
log.error("tenResumeService error:{}",e.getMessage());
|
|
|
- throw new RuntimeException("简历解析异常!");
|
|
|
+ throw new RuntimeException("简历解析失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ *
|
|
|
+ *
|
|
|
*
|
|
|
* @param fileName 简历文件名。请务必带上正确的文件后缀名,否则部分简历可能解析失败。
|
|
|
* @param fileCount 简历文件内容(以base64编码),其中:
|
|
@@ -101,7 +107,7 @@ public class TenResumeServiceImpl implements TenResumeService {
|
|
|
HttpResponse execute = post.execute();
|
|
|
String body = execute.body();
|
|
|
log.info("parse resume res->{}",body);
|
|
|
- System.out.println(body);
|
|
|
+// System.out.println(body);
|
|
|
TemResumeResVo temResumeResVo = JSON.parseObject(body, TemResumeResVo.class);
|
|
|
if(temResumeResVo.getStatus().getCode()!=200){
|
|
|
throw new RuntimeException("简历解析失败");
|