Commit ab25ca45 by zwb

新增简历模块优化

parent 28ed234a
...@@ -74,7 +74,7 @@ public class TokenController { ...@@ -74,7 +74,7 @@ public class TokenController {
/** /**
* 用户注册 * 用户注册
*/ */
@ApiEncrypt // @ApiEncrypt
@PostMapping("register") @PostMapping("register")
public R<Void> register(@RequestBody RegisterBody registerBody) { public R<Void> register(@RequestBody RegisterBody registerBody) {
// 用户注册 // 用户注册
......
...@@ -92,9 +92,9 @@ public class SysLoginService { ...@@ -92,9 +92,9 @@ public class SysLoginService {
boolean captchaEnabled = captchaProperties.getEnabled(); boolean captchaEnabled = captchaProperties.getEnabled();
// 验证码开关 // 验证码开关
if (captchaEnabled) { // if (captchaEnabled) {
validateCaptcha(tenantId, username, registerBody.getCode(), registerBody.getUuid()); // validateCaptcha(tenantId, username, registerBody.getCode(), registerBody.getUuid());
} // }
// 注册用户信息 // 注册用户信息
RemoteUserBo remoteUserBo = new RemoteUserBo(); RemoteUserBo remoteUserBo = new RemoteUserBo();
......
...@@ -2,6 +2,7 @@ package com.bkty.system.controller; ...@@ -2,6 +2,7 @@ package com.bkty.system.controller;
import com.bkty.system.api.model.LoginUser; import com.bkty.system.api.model.LoginUser;
import com.bkty.system.domain.dto.ModuleOptimizationDto;
import com.bkty.system.domain.dto.ResumeByPdfDto; import com.bkty.system.domain.dto.ResumeByPdfDto;
import com.bkty.system.domain.dto.ResumeListItemCache; import com.bkty.system.domain.dto.ResumeListItemCache;
import com.bkty.system.domain.dto.ResumeMakeDto; import com.bkty.system.domain.dto.ResumeMakeDto;
...@@ -16,6 +17,7 @@ import org.dromara.common.core.annotation.RepeatSubmit; ...@@ -16,6 +17,7 @@ import org.dromara.common.core.annotation.RepeatSubmit;
import org.dromara.common.core.domain.R; import org.dromara.common.core.domain.R;
import org.dromara.common.core.exception.JxgException; import org.dromara.common.core.exception.JxgException;
import org.dromara.common.core.exception.WarnException; import org.dromara.common.core.exception.WarnException;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.satoken.utils.LoginHelper; import org.dromara.common.satoken.utils.LoginHelper;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -138,4 +140,26 @@ public class NewEditionResumeController { ...@@ -138,4 +140,26 @@ public class NewEditionResumeController {
return new R<>(this.newEditionResumeService.createResumeHtml(dto.getResumeId(), dto.getTemplateName())); return new R<>(this.newEditionResumeService.createResumeHtml(dto.getResumeId(), dto.getTemplateName()));
} }
/**
* 简历模块优化
* @param dto
* @return
*/
@PostMapping("/queryModuleOptimization")
public R queryModuleOptimization(@RequestBody ModuleOptimizationDto dto) throws Exception {
if (StringUtils.isBlank(dto.getContent())){
throw new JxgException("待优化内容不能空");
}
if (StringUtils.isBlank(dto.getModule())){
throw new JxgException("模块类型不能为空");
}
if (StringUtils.isBlank(dto.getType())){
throw new JxgException("优化类型不能为空");
}
if (StringUtils.isBlank(dto.getResumeId())){
throw new JxgException("简历ID不能为空");
}
return new R<>(this.newEditionResumeService.queryModuleOptimization(dto));
}
} }
package com.bkty.system.domain.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* @author Herbert
* @description 简历模块优化请求类
* @data 2024/12/16
**/
@Data
@Schema(description = "简历模块优化请求类")
public class ModuleOptimizationDto {
@Schema(description = "待优化模块的JSON字符串")
private String content;
@Schema(description = "模块优化 只支持['workExps','internships','projects','clubs','advantage','skill']六种|图片识别 只支持[\"edus\",\"workExps\",\"internships\",\"projects\",\"clubs\"]五种")
private String module;
@Schema(description = "全文简历数据JSON")
private String resume;
@Schema(description = "优化类型:智能优化,扩写,缩写")
private String type;
@Schema(description = "简历ID")
private String resumeId;
}
package com.bkty.system.domain.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* @Desc:
* @author: Herbert
* @date: 2025/3/17 13:56
* @since: 17
*/
@Data
@Schema(description = "用户画像求职偏好统计返回类")
public class PortraitJobDto {
@Schema(description = "用户ID")
private String userId;
@Schema(description = "用户名称")
private String username;
@Schema(description = "期望职业")
private String career;
@Schema(description = "单位性质")
private String companyNature;
@Schema(description = "目标城市")
private String targetCity;
@Schema(description = "薪酬")
private String pay;
@Schema(description = "求职性质:1-实习,2-全职")
private String jobType;
@Schema(description = "手机号")
private String phone;
@Schema(description = "学号")
private String studentNumber;
@Schema(description = "学校ID")
private String schoolId;
@Schema(description = "学校名称")
private String schoolName;
@Schema(description = "MBTI测试结果")
private String mbti;
}
...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bkty.system.domain.entity.SysUser; import com.bkty.system.domain.entity.SysUser;
import com.bkty.system.domain.vo.SysUserExportVo; import com.bkty.system.domain.vo.SysUserExportVo;
import com.bkty.system.domain.vo.SysUserVo; import com.bkty.system.domain.vo.SysUserVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.dromara.common.mybatis.annotation.DataColumn; import org.dromara.common.mybatis.annotation.DataColumn;
import org.dromara.common.mybatis.annotation.DataPermission; import org.dromara.common.mybatis.annotation.DataPermission;
...@@ -18,6 +19,7 @@ import java.util.List; ...@@ -18,6 +19,7 @@ import java.util.List;
* *
* @author Lion Li * @author Lion Li
*/ */
@Mapper
public interface SysUserMapper extends BaseMapperPlus<SysUser, SysUserVo> { public interface SysUserMapper extends BaseMapperPlus<SysUser, SysUserVo> {
@DataPermission({ @DataPermission({
......
package com.bkty.system.service.resume; package com.bkty.system.service.resume;
import com.bkty.system.domain.dto.ModuleOptimizationDto;
import com.bkty.system.domain.dto.ResumeListItemCache; import com.bkty.system.domain.dto.ResumeListItemCache;
import com.bkty.system.domain.dto.ResumeMakeDto; import com.bkty.system.domain.dto.ResumeMakeDto;
import com.bkty.system.domain.vo.ResumeVo; import com.bkty.system.domain.vo.ResumeVo;
...@@ -69,4 +70,11 @@ public interface NewEditionResumeService { ...@@ -69,4 +70,11 @@ public interface NewEditionResumeService {
* @return * @return
*/ */
String createResumeHtml(String resumeId, String templateName); String createResumeHtml(String resumeId, String templateName);
/**
* 简历模块优化
* @param dto
*/
String queryModuleOptimization(ModuleOptimizationDto dto) throws Exception;
} }
...@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; ...@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.bkty.system.api.model.LoginUser; import com.bkty.system.api.model.LoginUser;
import com.bkty.system.config.AiConfigProperties; import com.bkty.system.config.AiConfigProperties;
import com.bkty.system.config.CommonAsyncThreadPool; import com.bkty.system.config.CommonAsyncThreadPool;
import com.bkty.system.domain.dto.ModuleOptimizationDto;
import com.bkty.system.domain.dto.ResumeListItemCache; import com.bkty.system.domain.dto.ResumeListItemCache;
import com.bkty.system.domain.dto.ResumeMakeDto; import com.bkty.system.domain.dto.ResumeMakeDto;
import com.bkty.system.domain.entity.*; import com.bkty.system.domain.entity.*;
...@@ -742,6 +743,39 @@ public class NewEditionResumeServiceImpl implements NewEditionResumeService { ...@@ -742,6 +743,39 @@ public class NewEditionResumeServiceImpl implements NewEditionResumeService {
return properties.getHtmlDown() + htmlName; return properties.getHtmlDown() + htmlName;
} }
@Override
public String queryModuleOptimization(ModuleOptimizationDto dto) throws Exception {
//调用 Coze API
String cozeToken = cozeApiService.getCozeTokenCn("CN");
String resumeJson = redisTemplate.opsForValue().get(CacheConstants.REDIS_USER_RESUME_RECOMMEND_KEY.formatted(dto.getResumeId()));
if(StringUtils.isNotBlank(resumeJson)){
dto.setResume(resumeJson);
}else {
ResumeVo vo = queryNewEditionResumeId(dto.getResumeId()).join();
dto.setResume(JSON.toJSONString(vo));
}
Map<String, Object> body = Map.of("workflow_id", "7572052446664425507", "is_async", false, "parameters", dto);
String url = Constants.HTTPS + CozeConstsnts.COZE_CN_API_DOMAIN_NAME + "/v1/workflow/run";
String response = HttpRequest.post(url)
.header("Content-Type", "application/json") // 添加请求头
.header(HttpHeaders.AUTHORIZATION, CozeConstsnts.COZE_TOKEN_BEARER + cozeToken) // 添加请求头
.body(JSON.toJSONString(body)) // 设置请求体(JSON字符串)
.execute()
.body();
JSONObject jsonObject = JSON.parseObject(response);
if (jsonObject.getInteger("code") == 0) {
JSONObject data = jsonObject.getJSONObject("data");
String result = data.getString("result");
return result;
}
return null;
}
/** /**
* 根据生日计算年龄 * 根据生日计算年龄
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment