|
@@ -2,16 +2,15 @@ package com.citu.module.menduner.system.service.resume;
|
|
|
|
|
|
import cn.hutool.core.codec.Base64;
|
|
|
import cn.hutool.http.HttpUtil;
|
|
|
-import com.citu.framework.common.pojo.CommonResult;
|
|
|
import com.citu.module.menduner.system.controller.base.person.info.PersonDetailExtendRespVO;
|
|
|
-import com.citu.module.menduner.system.controller.base.person.info.PersonDetailRespVO;
|
|
|
import com.citu.module.menduner.system.controller.base.resume.resumesdk.TemResumeResVo;
|
|
|
-import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
+import static com.citu.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
|
+import static com.citu.module.menduner.system.enums.ErrorCodeConstants.MDE_PERSON_RESUME_ERROR;
|
|
|
+
|
|
|
@Service
|
|
|
public class OnlineResumeServiceImpl implements OnlineResumeService {
|
|
|
|
|
@@ -24,6 +23,10 @@ public class OnlineResumeServiceImpl implements OnlineResumeService {
|
|
|
public TemResumeResVo resumeParser(String fileUrl) {
|
|
|
String fileName = fileUrl.substring(fileUrl.lastIndexOf("/") + 1);
|
|
|
byte[] bytes = HttpUtil.downloadBytes(fileUrl);
|
|
|
+ int mb10 = 10 * 1024 * 1024; // 直接大小
|
|
|
+ if (bytes.length >= mb10) {
|
|
|
+ throw exception(MDE_PERSON_RESUME_ERROR);
|
|
|
+ }
|
|
|
Base64 base64 = new Base64();
|
|
|
String fileContent = base64.encode(bytes);
|
|
|
return tenResumeService.tenResumeService(fileName, fileContent);
|
|
@@ -32,7 +35,7 @@ public class OnlineResumeServiceImpl implements OnlineResumeService {
|
|
|
@Override
|
|
|
public PersonDetailExtendRespVO parserByPerson(String fileUrl) {
|
|
|
TemResumeResVo temResumeResVo = resumeParser(fileUrl);
|
|
|
- PersonDetailExtendRespVO resp=new PersonDetailExtendRespVO();
|
|
|
+ PersonDetailExtendRespVO resp = new PersonDetailExtendRespVO();
|
|
|
// TODO 解析出简历对象后 赋值给resp
|
|
|
// TODO 没有的信息可不填
|
|
|
// TODO resp.info 人员基本信息 areaId、regId 需要取出省市区id,工作年限、工作经验通过 EducationTypeEnum|ExpTypeEnum 判断赋type值,其他基本信息根据情况填
|