添加agent相关配置
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package org.jiayunet.controller;
|
||||
|
||||
import org.jiayunet.pojo.dto.jobAgent.JobAgentConfigDto;
|
||||
import org.jiayunet.pojo.param.jobAgent.JobAgentConfigParam;
|
||||
import org.jiayunet.service.JobAgentConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 求职助手配置接口
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/job-agent")
|
||||
public class JobAgentConfigController {
|
||||
|
||||
@Autowired
|
||||
private JobAgentConfigService configService;
|
||||
|
||||
/**
|
||||
* 查询当前用户的求职助手配置
|
||||
*/
|
||||
@GetMapping("/config")
|
||||
public JobAgentConfigDto getConfig() {
|
||||
return configService.getConfig();
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存/更新求职助手配置
|
||||
*/
|
||||
@PostMapping("/config/save")
|
||||
public void saveConfig(@RequestBody JobAgentConfigParam param) {
|
||||
configService.saveConfig(param);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package org.jiayunet.pojo.dto.jobAgent;
|
||||
|
||||
import lombok.Data;
|
||||
import org.jiayunet.pojo.vo.LanguageAbility;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 求职助手配置出参
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
public class JobAgentConfigDto {
|
||||
|
||||
/** 工作类型 1=实习 2=全职 */
|
||||
private Integer jobType;
|
||||
|
||||
/** Agent模式 1=协作模式 2=托管模式 */
|
||||
private Integer agentMode;
|
||||
|
||||
/** 每周投递目标数量 1=少于20个 2=20到50个 3=多于50个 */
|
||||
private Integer weeklyTarget;
|
||||
|
||||
/** 投递时自动针对岗位优化简历 0=关闭 1=开启 */
|
||||
private Integer autoOptimizeResume;
|
||||
|
||||
/** 是否愿意接受部门调剂 */
|
||||
private String acceptDeptTransfer;
|
||||
|
||||
/** 是否接受地点调剂 */
|
||||
private String acceptLocationTransfer;
|
||||
|
||||
/** 可参加的面试方式 */
|
||||
private List<String> interviewType;
|
||||
|
||||
/** 语言能力 */
|
||||
private List<LanguageAbility> languages;
|
||||
|
||||
/** 预计到岗时间 */
|
||||
private String availableDate;
|
||||
|
||||
/** 每周可实习天数 */
|
||||
private String internDaysPerWeek;
|
||||
|
||||
/** 预计实习时长 */
|
||||
private String internDuration;
|
||||
|
||||
/** 状态 0=未启用 1=已启用 */
|
||||
private Integer status;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package org.jiayunet.pojo.param.jobAgent;
|
||||
|
||||
import lombok.Data;
|
||||
import org.jiayunet.pojo.vo.LanguageAbility;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 求职助手配置入参
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
public class JobAgentConfigParam {
|
||||
|
||||
/** 工作类型 1=实习 2=全职 */
|
||||
private Integer jobType;
|
||||
|
||||
/** Agent模式 1=协作模式 2=托管模式 */
|
||||
private Integer agentMode;
|
||||
|
||||
/** 每周投递目标数量 1=少于20个 2=20到50个 3=多于50个 */
|
||||
private Integer weeklyTarget;
|
||||
|
||||
/** 投递时自动针对岗位优化简历 0=关闭 1=开启 */
|
||||
private Integer autoOptimizeResume;
|
||||
|
||||
/** 是否愿意接受部门调剂,可选值:是/否 */
|
||||
private String acceptDeptTransfer;
|
||||
|
||||
/** 是否接受地点调剂,可选值:是/否 */
|
||||
private String acceptLocationTransfer;
|
||||
|
||||
/** 可参加的面试方式,可选值:线下面试/线上远程 */
|
||||
private List<String> interviewType;
|
||||
|
||||
/** 语言能力 */
|
||||
private List<LanguageAbility> languages;
|
||||
|
||||
/** 预计到岗时间,可选值:一周以内/两周以内/一个月以内/一个月以上 */
|
||||
private String availableDate;
|
||||
|
||||
/** 每周可实习天数,可选值:3天及以上/4天及以上/5天及以上 */
|
||||
private String internDaysPerWeek;
|
||||
|
||||
/** 预计实习时长,可选值:3个月/4个月/5个月/6个月及以上 */
|
||||
private String internDuration;
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package org.jiayunet.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.jiayunet.mapper.JobAgentConfigMapper;
|
||||
import org.jiayunet.pojo.dto.jobAgent.JobAgentConfigDto;
|
||||
import org.jiayunet.pojo.param.jobAgent.JobAgentConfigParam;
|
||||
import org.jiayunet.pojo.po.JobAgentConfig;
|
||||
import org.jiayunet.tool.UserSecurityTool;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* 求职助手配置服务
|
||||
* <p>主要功能:求职助手配置的查询和保存</p>
|
||||
* <p>使用表:bg_job_agent_config(查询/新增/更新)</p>
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Service
|
||||
public class JobAgentConfigService {
|
||||
|
||||
@Autowired
|
||||
private JobAgentConfigMapper configMapper;
|
||||
|
||||
/**
|
||||
* 查询当前用户的求职助手配置
|
||||
* <p>根据userId查询,不存在返回null</p>
|
||||
*/
|
||||
public JobAgentConfigDto getConfig() {
|
||||
Long userId = UserSecurityTool.getUserId();
|
||||
JobAgentConfig po = configMapper.selectOne(new LambdaQueryWrapper<JobAgentConfig>().eq(JobAgentConfig::getUserId, userId));
|
||||
if (po == null) {
|
||||
return null;
|
||||
}
|
||||
JobAgentConfigDto dto = new JobAgentConfigDto();
|
||||
BeanUtils.copyProperties(po, dto);
|
||||
return dto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存/更新求职助手配置
|
||||
* <p>先查询是否存在,存在则更新业务字段,不存在则新增(status默认0=未启用)</p>
|
||||
*/
|
||||
public void saveConfig(JobAgentConfigParam param) {
|
||||
Long userId = UserSecurityTool.getUserId();
|
||||
JobAgentConfig po = configMapper.selectOne(new LambdaQueryWrapper<JobAgentConfig>().eq(JobAgentConfig::getUserId, userId));
|
||||
|
||||
if (po == null) {
|
||||
po = new JobAgentConfig();
|
||||
po.setUserId(userId);
|
||||
BeanUtils.copyProperties(param, po);
|
||||
po.setStatus(0);
|
||||
po.setCreateTime(Instant.now());
|
||||
po.setUpdateTime(Instant.now());
|
||||
configMapper.insert(po);
|
||||
} else {
|
||||
BeanUtils.copyProperties(param, po);
|
||||
po.setUpdateTime(Instant.now());
|
||||
configMapper.updateById(po);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package org.jiayunet.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.jiayunet.pojo.po.JobAgentConfig;
|
||||
|
||||
/**
|
||||
* 求职助手配置Mapper
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Mapper
|
||||
public interface JobAgentConfigMapper extends CommonMapper<JobAgentConfig> {
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package org.jiayunet.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
||||
import lombok.Data;
|
||||
import org.jiayunet.pojo.vo.LanguageAbility;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 求职助手配置表(bg_job_agent_config)
|
||||
* <p>一个用户一条记录,存储Agent设置和网申常见问题的预设答案</p>
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "bg_job_agent_config", autoResultMap = true)
|
||||
public class JobAgentConfig {
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
|
||||
/** 用户ID */
|
||||
private Long userId;
|
||||
|
||||
/** 工作类型 1=实习 2=全职 */
|
||||
private Integer jobType;
|
||||
|
||||
/** Agent模式 1=协作模式 2=托管模式 */
|
||||
private Integer agentMode;
|
||||
|
||||
/** 每周投递目标数量 1=少于20个 2=20到50个 3=多于50个 */
|
||||
private Integer weeklyTarget;
|
||||
|
||||
/** 投递时自动针对岗位优化简历 0=关闭 1=开启 */
|
||||
private Integer autoOptimizeResume;
|
||||
|
||||
/** 是否愿意接受部门调剂,可选值:是/否 */
|
||||
private String acceptDeptTransfer;
|
||||
|
||||
/** 是否接受地点调剂,可选值:是/否 */
|
||||
private String acceptLocationTransfer;
|
||||
|
||||
/** 可参加的面试方式,JSON字符串数组,可选值:线下面试/线上远程 */
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<String> interviewType;
|
||||
|
||||
/** 语言能力,JSON对象数组,每项含language(语种)和proficiency(掌握程度) */
|
||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
||||
private List<LanguageAbility> languages;
|
||||
|
||||
/** 预计到岗时间,可选值:一周以内/两周以内/一个月以内/一个月以上 */
|
||||
private String availableDate;
|
||||
|
||||
/** 每周可实习天数,仅job_type=1时填写,可选值:3天及以上/4天及以上/5天及以上 */
|
||||
private String internDaysPerWeek;
|
||||
|
||||
/** 预计实习时长,仅job_type=1时填写,可选值:3个月/4个月/5个月/6个月及以上 */
|
||||
private String internDuration;
|
||||
|
||||
/** 状态 0=未启用 1=已启用 */
|
||||
private Integer status;
|
||||
|
||||
/** 创建时间 */
|
||||
private Instant createTime;
|
||||
|
||||
/** 更新时间 */
|
||||
private Instant updateTime;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.jiayunet.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 语言能力对象
|
||||
* <p>用于求职助手配置中的语言能力JSON字段</p>
|
||||
*
|
||||
* @author zk
|
||||
*/
|
||||
@Data
|
||||
public class LanguageAbility {
|
||||
|
||||
/** 语种,如英语、日语、法语等 */
|
||||
private String language;
|
||||
|
||||
/** 掌握程度,可选值:入门/日常会话/商务会话/无障碍沟通/母语 */
|
||||
private String proficiency;
|
||||
}
|
||||
Reference in New Issue
Block a user