AI助手和Nova助手
This commit is contained in:
@@ -0,0 +1,280 @@
|
||||
import request from '@/utils/request'
|
||||
import type { ApiResult } from '@/api/auth'
|
||||
|
||||
// ==================== 求职助手配置相关 ====================
|
||||
|
||||
/** 语言能力项 */
|
||||
export interface LanguageAbility {
|
||||
/** 语种,如英语、日语、法语等 */
|
||||
language?: string
|
||||
/** 掌握程度,可选值:入门/日常会话/商务会话/无障碍沟通/母语 */
|
||||
proficiency?: string
|
||||
}
|
||||
|
||||
/** 求职助手配置数据(查询返回 + 保存请求共用) */
|
||||
export interface AgentConfig {
|
||||
/** 工作类型 1=实习 2=全职 */
|
||||
jobType?: number
|
||||
/** Agent模式 1=协作模式 2=托管模式 */
|
||||
agentMode?: number
|
||||
/** 每周投递目标数量 1=少于20个 2=20到50个 3=多于50个 */
|
||||
weeklyTarget?: number
|
||||
/** 投递时自动针对岗位优化简历 0=关闭 1=开启 */
|
||||
autoOptimizeResume?: number
|
||||
/** 是否愿意接受部门调剂 */
|
||||
acceptDeptTransfer?: string
|
||||
/** 是否接受地点调剂 */
|
||||
acceptLocationTransfer?: string
|
||||
/** 可参加的面试方式 */
|
||||
interviewType?: string[]
|
||||
/** 语言能力 */
|
||||
languages?: LanguageAbility[]
|
||||
/** 预计到岗时间 */
|
||||
availableDate?: string
|
||||
/** 每周可实习天数 */
|
||||
internDaysPerWeek?: string
|
||||
/** 预计实习时长 */
|
||||
internDuration?: string
|
||||
/** 状态 0=未启用 1=已启用(仅查询返回) */
|
||||
status?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询求职助手配置
|
||||
* GET /job-agent/config
|
||||
*/
|
||||
export function fetchAgentConfig() {
|
||||
return request.get<any, ApiResult<AgentConfig>>('/job-agent/config')
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存求职助手配置
|
||||
* POST /job-agent/config/save
|
||||
*/
|
||||
export function saveAgentConfig(data: AgentConfig) {
|
||||
return request.post<any, ApiResult>('/job-agent/config/save', data)
|
||||
}
|
||||
|
||||
// ==================== 求职助手岗位推荐 ====================
|
||||
|
||||
/** 匹配度详情 */
|
||||
export interface AgentJobMatchDetail {
|
||||
/** 学历匹配分 */
|
||||
educationScore: number
|
||||
/** 技能匹配分 */
|
||||
skillScore: number
|
||||
/** 经验匹配分 */
|
||||
experienceScore: number
|
||||
}
|
||||
|
||||
/** 推荐岗位项 */
|
||||
export interface AgentRecommendJob {
|
||||
/** 岗位 ID */
|
||||
id: number
|
||||
/** 岗位名称 */
|
||||
title: string
|
||||
/** 薪资描述 */
|
||||
salary: string
|
||||
/** 公司名称 */
|
||||
companyName: string
|
||||
/** 公司简称 */
|
||||
companyShortName: string
|
||||
/** 公司类型 */
|
||||
companyType: string
|
||||
/** 公司 Logo */
|
||||
companyLogoUrl: string
|
||||
/** 地区名称 */
|
||||
regionName: string
|
||||
/** 岗位类型名称 */
|
||||
categoryName: string
|
||||
/** 岗位标签 */
|
||||
tags: string[]
|
||||
/** 来源链接 */
|
||||
sourceUrl: string
|
||||
/** 是否收藏 */
|
||||
isFavorite: boolean
|
||||
/** 投递状态(null=未投递,-1=待投递,0=已投递 1=面试中 2=有Offer 3=未通过 4=已结束) */
|
||||
applicationStatus: number | null
|
||||
/** 岗位状态(0=有效 1=已下架 2=已过期) */
|
||||
status: number
|
||||
/** 匹配总分(0-90) */
|
||||
matchScore: number
|
||||
/** 匹配度详情 */
|
||||
matchDetail: AgentJobMatchDetail
|
||||
}
|
||||
|
||||
/** 求职助手岗位推荐返回数据 */
|
||||
export interface AgentRecommendResult {
|
||||
/** 推荐说明(20字以内) */
|
||||
summary: string
|
||||
/** 推荐的岗位列表(8-10个) */
|
||||
list: AgentRecommendJob[]
|
||||
}
|
||||
|
||||
/** 求职助手岗位推荐请求参数 */
|
||||
export interface AgentRecommendParams {
|
||||
/** 用户偏好描述 */
|
||||
preference?: string
|
||||
/** 排除已推荐过的岗位 ID 列表(字符串避免大整数精度丢失) */
|
||||
excludeJobIds?: (number | string)[]
|
||||
}
|
||||
|
||||
/**
|
||||
* 求职助手岗位推荐
|
||||
* POST /job/agent/recommend
|
||||
*/
|
||||
export function fetchAgentRecommend(params: AgentRecommendParams = {}) {
|
||||
return request.post<any, ApiResult<AgentRecommendResult>>('/job/agent/recommend', params)
|
||||
}
|
||||
|
||||
// ==================== 岗位投递状态变更 ====================
|
||||
|
||||
/** 岗位投递请求参数 */
|
||||
export interface JobApplyParams {
|
||||
/** 岗位 ID */
|
||||
jobId: number
|
||||
/** 投递状态:-1=待投递 0=已投递 1=面试中 2=有Offer 3=未通过 4=已结束,null=取消 */
|
||||
status: number | null
|
||||
}
|
||||
|
||||
/**
|
||||
* 变更岗位投递状态(添加到待投递等)
|
||||
* POST /job/apply
|
||||
*/
|
||||
export function applyJob(params: JobApplyParams) {
|
||||
return request.post<any, ApiResult>('/job/apply', params)
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消投递 / 从待投递移除
|
||||
* DELETE /job/apply?jobId=xxx
|
||||
* @param jobId 岗位 ID
|
||||
*/
|
||||
export function cancelApplyJob(jobId: number) {
|
||||
return request.delete<any, ApiResult>('/job/apply', {
|
||||
params: { jobId },
|
||||
})
|
||||
}
|
||||
|
||||
// ==================== Agent 对话消息 ====================
|
||||
|
||||
/** 消息创建时间 */
|
||||
export interface InstantTime {
|
||||
/** 距 1970-01-01T00:00:00Z 的秒数 */
|
||||
seconds: number
|
||||
/** 纳秒偏移(0 ~ 999,999,999) */
|
||||
nanos: number
|
||||
}
|
||||
|
||||
/** Agent 对话消息项 */
|
||||
export interface AgentChatMessage {
|
||||
/** 消息 ID */
|
||||
id: number
|
||||
/** 消息类型:user / assistant / recommend / apply_progress */
|
||||
type: string
|
||||
/** 文本内容 */
|
||||
content: string
|
||||
/** 附加数据 JSON(如推荐岗位列表等) */
|
||||
extra: string
|
||||
/** 创建时间 */
|
||||
createTime: InstantTime
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前 Agent 对话消息列表
|
||||
* GET /job-agent/chat/messages?limit=xxx
|
||||
* @param limit 查询条数
|
||||
*/
|
||||
export function fetchAgentChatMessages(limit: number = 50) {
|
||||
return request.get<any, ApiResult<AgentChatMessage[]>>('/job-agent/chat/messages', {
|
||||
params: { limit },
|
||||
})
|
||||
}
|
||||
|
||||
/** 添加对话消息请求参数 */
|
||||
export interface AddChatMessageParams {
|
||||
/** 消息类型:user / assistant / recommend / apply_progress */
|
||||
type: string
|
||||
/** 文本内容 */
|
||||
content?: string
|
||||
/** 附加数据 JSON */
|
||||
extra?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加 Agent 对话消息
|
||||
* POST /job-agent/chat/message
|
||||
*/
|
||||
export function addAgentChatMessage(params: AddChatMessageParams) {
|
||||
return request.post<any, ApiResult>('/job-agent/chat/message', params)
|
||||
}
|
||||
|
||||
// ==================== 批量查询岗位投递记录 ====================
|
||||
|
||||
/** 岗位投递记录项 */
|
||||
export interface JobApplyRecord {
|
||||
/** 岗位 ID */
|
||||
jobId: number
|
||||
/** 投递状态:-1=待投递 0=已投递 1=面试中 2=有Offer 3=未通过 4=已结束 */
|
||||
status: number
|
||||
/** 投递时间 */
|
||||
applyTime: InstantTime
|
||||
/** 创建时间 */
|
||||
createTime: InstantTime
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据岗位 ID 批量查询投递记录
|
||||
* POST /job/apply/listByJobIds
|
||||
* @param jobIds 岗位 ID 列表
|
||||
*/
|
||||
export function fetchApplyByJobIds(jobIds: number[]) {
|
||||
return request.post<any, ApiResult<JobApplyRecord[]>>('/job/apply/listByJobIds', jobIds)
|
||||
}
|
||||
|
||||
// ==================== Agent AI 对话(Python 后端) ====================
|
||||
|
||||
import aiService from '@/utils/aiRequest'
|
||||
import type { AiResult } from '@/utils/aiRequest'
|
||||
|
||||
/** AI 对话历史消息项 */
|
||||
export interface AgentChatHistoryItem {
|
||||
/** 角色:user / assistant */
|
||||
role: string
|
||||
/** 消息内容 */
|
||||
content: string
|
||||
}
|
||||
|
||||
/** Agent AI 对话请求参数 */
|
||||
export interface AgentChatParams {
|
||||
/** 用户输入的消息 */
|
||||
message: string
|
||||
/** 简历 ID(字符串,避免大整数精度丢失) */
|
||||
resumeId: string
|
||||
/** 对话历史 */
|
||||
history?: AgentChatHistoryItem[]
|
||||
/** 意向岗位类型名称 */
|
||||
jobCategories?: string[]
|
||||
/** 意向城市名称 */
|
||||
regions?: string[]
|
||||
/** 意向行业名称 */
|
||||
industries?: string[]
|
||||
}
|
||||
|
||||
/** Agent AI 对话返回数据 */
|
||||
export interface AgentChatResponse {
|
||||
/** AI 回复的消息内容 */
|
||||
message: string
|
||||
/** 工具调用名称(null=普通回复,recommend=推荐岗位) */
|
||||
tool: string | null
|
||||
/** 工具调用参数 */
|
||||
toolParams: Record<string, any> | null
|
||||
}
|
||||
|
||||
/**
|
||||
* Agent AI 对话(Python 后端)
|
||||
* POST /job-agent/chat
|
||||
*/
|
||||
export function sendAgentChat(params: AgentChatParams) {
|
||||
return aiService.post<any, { data: AiResult<AgentChatResponse> }>('/job-agent/chat', params).then(res => res.data)
|
||||
}
|
||||
+7
-3
@@ -488,9 +488,11 @@ export interface CustomizeResumeData {
|
||||
/**
|
||||
* 查询定制简历结果(AI 接口)
|
||||
* GET /job/customize-resume
|
||||
* @param jobId 岗位ID(必需)
|
||||
*/
|
||||
export function fetchCustomizeResume() {
|
||||
export function fetchCustomizeResume(jobId: string) {
|
||||
return aiService.get<any, { data: AiResult<CustomizeResumeData | null> }>('/job/customize-resume', {
|
||||
params: { job_id: jobId },
|
||||
transformResponse: [(data: string) => {
|
||||
try {
|
||||
const processed = data.replace(/:\s*(\d{16,})/g, ':"$1"')
|
||||
@@ -585,8 +587,9 @@ export function aiEditResume(params: AiEditResumeParams) {
|
||||
* 撤销AI对话编辑简历的修改(AI 接口)
|
||||
* POST /job/customize-resume/rollback
|
||||
*/
|
||||
export function rollbackCustomizeResume() {
|
||||
export function rollbackCustomizeResume(jobId: string) {
|
||||
return aiService.post<any, { data: AiResult<null> }>('/job/customize-resume/rollback', null, {
|
||||
params: { job_id: jobId },
|
||||
transformResponse: [(data: string) => {
|
||||
try {
|
||||
const processed = data.replace(/:\s*(\d{16,})/g, ':"$1"')
|
||||
@@ -604,8 +607,9 @@ export function rollbackCustomizeResume() {
|
||||
* 输入框失焦或选择器选中后自动调用
|
||||
* @param data 定制简历完整数据
|
||||
*/
|
||||
export function updateCustomizeResume(data: CustomizeResumeData) {
|
||||
export function updateCustomizeResume(data: CustomizeResumeData,jobId: string) {
|
||||
return aiService.put<any, { data: AiResult<null> }>('/job/customize-resume', data, {
|
||||
params: { job_id: jobId },
|
||||
transformResponse: [(raw: string) => {
|
||||
try {
|
||||
const processed = raw.replace(/:\s*(\d{16,})/g, ':"$1"')
|
||||
|
||||
+157
-9
@@ -23,10 +23,10 @@ export interface ResumeListItem {
|
||||
targetPosition?: string
|
||||
/** 是否默认简历 0=否 1=是 */
|
||||
isDefault?: number
|
||||
/** 简历修改时间 */
|
||||
updateTime?: InstantTime
|
||||
/** 简历创建时间 */
|
||||
createTime?: InstantTime
|
||||
/** 简历修改时间(毫秒时间戳) */
|
||||
updateTime?: number
|
||||
/** 简历创建时间(毫秒时间戳) */
|
||||
createTime?: number
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -275,6 +275,8 @@ export function saveResumeMain(data: SaveResumeMainParams) {
|
||||
|
||||
/** 保存简历教育经历参数(单条) */
|
||||
export interface SaveResumeEducationItem {
|
||||
/** 记录ID(编辑时必传) */
|
||||
id?: string | number
|
||||
/** 学校名称 */
|
||||
school?: string
|
||||
/** 专业 */
|
||||
@@ -292,15 +294,45 @@ export interface SaveResumeEducationItem {
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存简历教育经历(全量覆盖)
|
||||
* 保存简历教育经历(全量覆盖)— 旧接口,保留兼容
|
||||
* POST /resume/education
|
||||
*/
|
||||
export function saveResumeEducation(resumeId: string, data: SaveResumeEducationItem[]) {
|
||||
return request.post<any, ApiResult>('/resume/education', { resumeId, items: data })
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加单条教育经历,返回新记录ID
|
||||
* POST /resume/education/add
|
||||
*/
|
||||
export function addResumeEducation(resumeId: string, data: SaveResumeEducationItem) {
|
||||
return request.post<any, ApiResult<string>>('/resume/education/add', data, {
|
||||
params: { resumeId },
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID编辑单条教育经历
|
||||
* POST /resume/education/update
|
||||
*/
|
||||
export function updateResumeEducation(data: SaveResumeEducationItem) {
|
||||
return request.post<any, ApiResult>('/resume/education/update', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID删除单条教育经历
|
||||
* POST /resume/education/delete
|
||||
*/
|
||||
export function deleteResumeEducation(id: string) {
|
||||
return request.post<any, ApiResult>('/resume/education/delete', null, {
|
||||
params: { id },
|
||||
})
|
||||
}
|
||||
|
||||
/** 保存简历工作经历参数(单条) */
|
||||
export interface SaveResumeWorkItem {
|
||||
/** 记录ID(编辑时必传) */
|
||||
id?: string | number
|
||||
/** 公司名称 */
|
||||
companyName?: string
|
||||
/** 职位 */
|
||||
@@ -314,7 +346,7 @@ export interface SaveResumeWorkItem {
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存简历工作经历(全量覆盖)
|
||||
* 保存简历工作经历(全量覆盖)— 旧接口,保留兼容
|
||||
* POST /resume/work
|
||||
*/
|
||||
export function saveResumeWork(resumeId: string, data: SaveResumeWorkItem[]) {
|
||||
@@ -322,15 +354,73 @@ export function saveResumeWork(resumeId: string, data: SaveResumeWorkItem[]) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存简历实习经历(全量覆盖)
|
||||
* 添加单条工作经历,返回新记录ID
|
||||
* POST /resume/work/add
|
||||
*/
|
||||
export function addResumeWork(resumeId: string, data: SaveResumeWorkItem) {
|
||||
return request.post<any, ApiResult<string>>('/resume/work/add', data, {
|
||||
params: { resumeId },
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID编辑单条工作经历
|
||||
* POST /resume/work/update
|
||||
*/
|
||||
export function updateResumeWork(data: SaveResumeWorkItem) {
|
||||
return request.post<any, ApiResult>('/resume/work/update', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID删除单条工作经历
|
||||
* POST /resume/work/delete
|
||||
*/
|
||||
export function deleteResumeWork(id: string) {
|
||||
return request.post<any, ApiResult>('/resume/work/delete', null, {
|
||||
params: { id },
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存简历实习经历(全量覆盖)— 旧接口,保留兼容
|
||||
* POST /resume/internship
|
||||
*/
|
||||
export function saveResumeInternship(resumeId: string, data: SaveResumeWorkItem[]) {
|
||||
return request.post<any, ApiResult>('/resume/internship', { resumeId, items: data })
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加单条实习经历,返回新记录ID
|
||||
* POST /resume/internship/add
|
||||
*/
|
||||
export function addResumeInternship(resumeId: string, data: SaveResumeWorkItem) {
|
||||
return request.post<any, ApiResult<string>>('/resume/internship/add', data, {
|
||||
params: { resumeId },
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID编辑单条实习经历
|
||||
* POST /resume/internship/update
|
||||
*/
|
||||
export function updateResumeInternship(data: SaveResumeWorkItem) {
|
||||
return request.post<any, ApiResult>('/resume/internship/update', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID删除单条实习经历
|
||||
* POST /resume/internship/delete
|
||||
*/
|
||||
export function deleteResumeInternship(id: string) {
|
||||
return request.post<any, ApiResult>('/resume/internship/delete', null, {
|
||||
params: { id },
|
||||
})
|
||||
}
|
||||
|
||||
/** 保存简历项目经历参数(单条) */
|
||||
export interface SaveResumeProjectItem {
|
||||
/** 记录ID(编辑时必传) */
|
||||
id?: string | number
|
||||
/** 项目名称 */
|
||||
projectName?: string
|
||||
/** 所属公司 */
|
||||
@@ -346,15 +436,45 @@ export interface SaveResumeProjectItem {
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存简历项目经历(全量覆盖)
|
||||
* 保存简历项目经历(全量覆盖)— 旧接口,保留兼容
|
||||
* POST /resume/project
|
||||
*/
|
||||
export function saveResumeProject(resumeId: string, data: SaveResumeProjectItem[]) {
|
||||
return request.post<any, ApiResult>('/resume/project', { resumeId, items: data })
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加单条项目经历,返回新记录ID
|
||||
* POST /resume/project/add
|
||||
*/
|
||||
export function addResumeProject(resumeId: string, data: SaveResumeProjectItem) {
|
||||
return request.post<any, ApiResult<string>>('/resume/project/add', data, {
|
||||
params: { resumeId },
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID编辑单条项目经历
|
||||
* POST /resume/project/update
|
||||
*/
|
||||
export function updateResumeProject(data: SaveResumeProjectItem) {
|
||||
return request.post<any, ApiResult>('/resume/project/update', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID删除单条项目经历
|
||||
* POST /resume/project/delete
|
||||
*/
|
||||
export function deleteResumeProject(id: string) {
|
||||
return request.post<any, ApiResult>('/resume/project/delete', null, {
|
||||
params: { id },
|
||||
})
|
||||
}
|
||||
|
||||
/** 保存简历竞赛经历参数(单条) */
|
||||
export interface SaveResumeCompetitionItem {
|
||||
/** 记录ID(编辑时必传) */
|
||||
id?: string | number
|
||||
/** 竞赛名称 */
|
||||
competitionName?: string
|
||||
/** 获奖情况 */
|
||||
@@ -366,13 +486,41 @@ export interface SaveResumeCompetitionItem {
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存简历竞赛经历(全量覆盖)
|
||||
* 保存简历竞赛经历(全量覆盖)— 旧接口,保留兼容
|
||||
* POST /resume/competition
|
||||
*/
|
||||
export function saveResumeCompetition(resumeId: string, data: SaveResumeCompetitionItem[]) {
|
||||
return request.post<any, ApiResult>('/resume/competition', { resumeId, items: data })
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加单条竞赛经历,返回新记录ID
|
||||
* POST /resume/competition/add
|
||||
*/
|
||||
export function addResumeCompetition(resumeId: string, data: SaveResumeCompetitionItem) {
|
||||
return request.post<any, ApiResult<string>>('/resume/competition/add', data, {
|
||||
params: { resumeId },
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID编辑单条竞赛经历
|
||||
* POST /resume/competition/update
|
||||
*/
|
||||
export function updateResumeCompetition(data: SaveResumeCompetitionItem) {
|
||||
return request.post<any, ApiResult>('/resume/competition/update', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID删除单条竞赛经历
|
||||
* POST /resume/competition/delete
|
||||
*/
|
||||
export function deleteResumeCompetition(id: string) {
|
||||
return request.post<any, ApiResult>('/resume/competition/delete', null, {
|
||||
params: { id },
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除简历
|
||||
* POST /resume/delete
|
||||
|
||||
Reference in New Issue
Block a user