|
@@ -4,6 +4,7 @@ import cn.hutool.core.codec.Base64;
|
|
import cn.hutool.http.HttpUtil;
|
|
import cn.hutool.http.HttpUtil;
|
|
import com.citu.framework.common.pojo.CommonResult;
|
|
import com.citu.framework.common.pojo.CommonResult;
|
|
import com.citu.module.menduner.system.controller.base.resume.resumesdk.TemResumeResVo;
|
|
import com.citu.module.menduner.system.controller.base.resume.resumesdk.TemResumeResVo;
|
|
|
|
+import com.citu.module.menduner.system.enums.ErrorCodeConstants;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -19,6 +20,10 @@ public class OnlineResumeServiceImpl implements OnlineResumeService {
|
|
public CommonResult<TemResumeResVo> resumeParser(String fileUrl) {
|
|
public CommonResult<TemResumeResVo> resumeParser(String fileUrl) {
|
|
String fileName = fileUrl.substring(fileUrl.lastIndexOf("/") + 1);
|
|
String fileName = fileUrl.substring(fileUrl.lastIndexOf("/") + 1);
|
|
byte[] bytes = HttpUtil.downloadBytes(fileUrl);
|
|
byte[] bytes = HttpUtil.downloadBytes(fileUrl);
|
|
|
|
+ int mb10 = 10*1024*1024; // 直接大小
|
|
|
|
+ if(bytes.length >=mb10){
|
|
|
|
+ return CommonResult.error(ErrorCodeConstants.MDE_PERSON_RESUME_ERROR);
|
|
|
|
+ }
|
|
Base64 base64 = new Base64();
|
|
Base64 base64 = new Base64();
|
|
String fileContent = base64.encode(bytes);
|
|
String fileContent = base64.encode(bytes);
|
|
CommonResult<TemResumeResVo> commonResult = tenResumeService.tenResumeService(fileName,fileContent);
|
|
CommonResult<TemResumeResVo> commonResult = tenResumeService.tenResumeService(fileName,fileContent);
|