仓库初始化+岗位相关页面

This commit is contained in:
2026-03-24 21:06:00 +08:00
commit 0468339d23
113 changed files with 18644 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
import request from '@/utils/request'
/** 通用响应结构 */
export interface ApiResult<T = any> {
code: string
msg: string
data?: T
timestamp: string
uuid: string
}
/** 登录成功返回的用户信息 */
export interface LoginData {
userId: string
nick: string
}
/**
* 发送短信验证码
* POST /public/sms/sendCode?mobileNumber=xxx
* 返回 data: true 表示发送成功,data: false 表示发送失败
*/
export function sendSmsCode(mobileNumber: string) {
return request.post<any, ApiResult<boolean>>('/public/sms/sendCode', null, {
params: { mobileNumber },
})
}
/**
* 短信验证码登录
* POST /public/login/smsLogin
* Body: { mobileNumber, code, inviteCode? }
* 登录成功后后端会 Set-Cookie: Token=xxx
*/
export function smsLogin(mobileNumber: string, code: string, inviteCode?: string) {
return request.post<any, ApiResult<LoginData>>('/public/login/smsLogin', {
mobileNumber,
code,
...(inviteCode ? { inviteCode } : {}),
})
}
/**
* 退出登录
* POST /public/logout
* 不需要参数,Cookie 会自动携带
*/
export function logout() {
return request.post<any, ApiResult>('/public/logout')
}
+91
View File
@@ -0,0 +1,91 @@
import request from '@/utils/request'
import type { ApiResult } from '@/api/auth'
/** 行业树节点(二级) */
export interface IndustryChild {
id: string
name: string
level: number
}
/** 行业树节点(一级,含子节点) */
export interface IndustryItem {
id: string
name: string
level: number
children: IndustryChild[]
}
/**
* 获取行业树分类数据
* GET /public/industries/tree
* 返回一级二级嵌套的行业分类
*/
export function fetchIndustryTree() {
return request.get<any, ApiResult<IndustryItem[]>>('/public/industries/tree')
}
// ==================== 岗位分类相关 ====================
/** 岗位树节点(三级 / 末级) */
export interface JobCategoryLeaf {
id: string
name: string
level: number
}
/** 岗位树节点(二级,含三级子节点) */
export interface JobCategoryChild {
id: string
name: string
level: number
children: JobCategoryLeaf[]
}
/** 岗位树节点(一级,含二级子节点) */
export interface JobCategoryItem {
id: string
name: string
level: number
children: JobCategoryChild[]
}
/**
* 获取岗位树分类数据
* GET /public/job-categories/tree
* 返回一级二级三级嵌套的岗位分类
*/
export function fetchJobCategoryTree() {
return request.get<any, ApiResult<JobCategoryItem[]>>('/public/job-categories/tree')
}
// ==================== 地区分类相关 ====================
/** 地区树节点(三级 / 区县级) */
export interface RegionLeaf {
code: string
name: string
}
/** 地区树节点(二级 / 市级,可能含三级子节点) */
export interface RegionChild {
code: string
name: string
children?: RegionLeaf[]
}
/** 地区树节点(一级 / 省级,含二级子节点) */
export interface RegionItem {
code: string
name: string
children: RegionChild[]
}
/**
* 获取地区树分类数据
* GET /public/regions/tree
* 返回省市区三级嵌套的地区分类
*/
export function fetchRegionTree() {
return request.get<any, ApiResult<RegionItem[]>>('/public/regions/tree')
}
+192
View File
@@ -0,0 +1,192 @@
import request from '@/utils/request'
import type { ApiResult } from '@/api/auth'
// ==================== 匹配详情 ====================
/** 匹配度详情 */
export interface MatchDetail {
/** 行业匹配分 */
industryScore: number
/** 技能匹配分 */
skillScore: number
/** 经验匹配分 */
experienceScore: number
}
// ==================== 岗位列表项 ====================
/** 岗位列表项(接口返回结构) */
export interface JobListItem {
/** 岗位 ID */
id: string
/** 岗位标题 */
title: string
/** 公司全称 */
companyName: string
/** 公司简称 */
companyShortName: string
/** 公司类型(如"上市企业" */
companyType: string
/** 地区名称 */
regionName: string
/** 岗位分类名称 */
categoryName: string
/** 标签列表 */
tags: string[]
/** 原始招聘链接 */
sourceUrl: string
/** 是否已收藏 */
isFavorite: boolean
/** 岗位状态:0=有效 1=已下架 2=已过期 */
status: number
/** 综合匹配分(0-100 */
matchScore: number
/** 匹配度详情 */
matchDetail: MatchDetail
}
// ==================== 分页结构 ====================
/** 分页数据结构 */
export interface JobPageData {
/** 当前页码 */
pageNum: string
/** 每页条数 */
pageSize: string
/** 总记录数 */
total: string
/** 岗位列表 */
list: JobListItem[]
}
// ==================== 请求参数 ====================
/** 岗位列表请求参数 */
export interface JobListParams {
/** 当前页码,从1开始,默认1 */
pageNum?: number
/** 每页条数,默认15 */
pageSize?: number
/** 地区编码列表 */
regionCodes?: string[]
/** 岗位类型 ID 列表 */
categoryIds?: number[]
/** 行业 ID 列表 */
industryIds?: number[]
/** 工作类型:0=全职 1=兼职 */
employmentType?: number
/** 指定岗位 ID 列表(用于收藏列表) */
jobIds?: number[]
/** 岗位状态过滤(0=有效 1=已下架 2=已过期,可多选,null或空=查所有) */
statusFilter?: number[]
}
// ==================== 接口方法 ====================
/**
* 获取岗位列表
* POST /job/list
* @param params 岗位列表查询参数
*/
export function fetchJobList(params: JobListParams = {}) {
return request.post<any, ApiResult<JobPageData>>('/job/list', {
pageNum: params.pageNum ?? 1,
pageSize: params.pageSize ?? 15,
...params,
})
}
// ==================== 岗位详情 ====================
/** 匹配度详情(岗位详情用) */
export interface JobMatchScoreDto {
/** 行业得分(0-100 */
industryScore: number
/** 技能得分(0-100 */
skillScore: number
/** 经验得分(0-100 */
experienceScore: number
}
/** 岗位详情出参 */
export interface JobDetailData {
/** 岗位 ID */
jobId: string
/** 岗位标题 */
jobTitle: string
/** 薪资描述 */
salary: string
/** 工作类型 0=全职 1=兼职 */
employmentType: number
/** 学历要求 0=不限 1=大专 2=本科 3=硕士 4=博士 */
education: number
/** 最低工作年限 */
minExperience: number
/** 岗位职责 */
description: string
/** 任职要求 */
requirement: string
/** 加分项 */
bonus: string
/** 岗位标签 */
tags: string[]
/** 技能标签 */
skillTags: string[]
/** 来源链接 */
sourceUrl: string
/** 岗位类型名称 */
categoryName: string
/** 要求的行业经验名称 */
requiredIndustryName: string
/** 公司 ID */
companyId: string
/** 公司名称 */
companyName: string
/** 公司简称 */
companyShortName: string
/** 公司 Logo URL */
companyLogoUrl: string
/** 公司类型 */
companyType: string
/** 公司所属行业名称 */
companyIndustryName: string
/** 公司标签 */
companyTags: string[]
/** 公司简介 */
companySummary: string
/** 公司描述 */
companyDescription: string
/** 成立时间 */
companyFoundedYear: string
/** 公司地址 */
companyAddress: string
/** 公司规模 */
companyScale: string
/** 公司官网 */
companyWebsite: string
/** 融资状态 */
companyFinancingStage: string
/** 最新估值 */
companyLatestValuation: string
/** 公司新闻 */
companyNews: string[]
/** 地区名称 */
regionName: string
/** 匹配总分 */
matchScore: number
/** 匹配度详情 */
matchDetail: JobMatchScoreDto
/** 是否已收藏 */
isFavorite: boolean
}
/**
* 获取岗位详情
* GET /job/detail?jobId=xxx
* @param jobId 岗位 ID
*/
export function fetchJobDetail(jobId: string) {
return request.get<any, ApiResult<JobDetailData>>('/job/detail', {
params: { jobId },
})
}
+35
View File
@@ -0,0 +1,35 @@
/**
* 获取当前用户有权限的路由列表
*
* 【mock 阶段】直接返回写死的数据,模拟后端接口
* 【对接真实接口时】把下面的 mock 数据替换成:
* return axios.get('/api/user/menus').then(res => res.data)
*
* 返回格式约定:
* path — 路由路径
* name — 路由名称(唯一标识,也用于 removeRoute
* component — 字符串,对应前端组件映射表的 key
* meta — 可选,传给路由的 meta 信息(图标、标题等)
*/
export interface MenuItemRaw {
path: string
name: string
component: string
meta?: {
label?: string
icon?: string
badge?: string
/** 'footer' 表示该菜单项显示在底部区域而非主导航 */
position?: string
}
}
export async function fetchUserRoutes(): Promise<MenuItemRaw[]> {
// TODO: 替换为真实接口 → return axios.get('/api/user/menus').then(res => res.data)
return [
{ path: '/agent', name: 'Agent', component: 'Agent', meta: { label: 'AI助手', icon: 'nav-agent-icon', badge: 'NEW' } },
{ path: '/profile', name: 'Profile', component: 'Profile', meta: { label: '个人资料', icon: 'nav-profile-icon' } },
{ path: '/resume', name: 'Resume', component: 'Resume', meta: { label: '简历', icon: 'nav-resume-icon' } },
{ path: '/settings', name: 'Settings', component: 'Settings', meta: { label: '设置', icon: 'nav-setting-icon', position: 'footer' } },
]
}
+309
View File
@@ -0,0 +1,309 @@
import request from '@/utils/request'
import type { ApiResult } from '@/api/auth'
// ==================== 个人资料主表相关 ====================
/** 保存/更新个人资料主表 — 请求参数 */
export interface SaveProfileParams {
/** 真实姓名 */
name?: string
/** 邮箱 */
email?: string
/** 手机号码 */
mobileNumber?: string
/** 身份证号 */
idCard?: string
/** 所在城市编码 */
regionCode?: string
/** 微信号 */
wechatNumber?: string
/** 作品集链接 */
portfolioUrl?: string
/** 工作年限 */
workYears?: number
/** 拥有经验的行业ID列表 */
experienceIndustryIds?: number[]
/** 技能标签列表 */
skills?: string[]
/** 证书标签列表 */
certificates?: string[]
}
/**
* 保存/更新个人资料主表信息
* POST /user/profile
* Cookie 自动携带身份信息,无需额外传 userId
*/
export function saveProfile(data: SaveProfileParams) {
return request.post<any, ApiResult>('/user/profile', data)
}
/** 获取个人资料主表 — 返回数据结构 */
export interface ProfileData {
/** 主键 ID */
id?: number
/** 真实姓名 */
name?: string
/** 邮箱 */
email?: string
/** 手机号码 */
mobileNumber?: string
/** 身份证号 */
idCard?: string
/** 所在城市编码 */
regionCode?: string
/** 微信号 */
wechatNumber?: string
/** 作品集链接 */
portfolioUrl?: string
/** 工作年限 */
workYears?: number
/** 拥有经验的行业ID列表 */
experienceIndustryIds?: number[]
/** 技能标签列表 */
skills?: string[]
/** 证书标签列表 */
certificates?: string[]
}
/**
* 获取个人资料主表信息
* GET /user/profile
* Cookie 自动携带身份信息,无需额外传参
*/
export function fetchProfile() {
return request.get<any, ApiResult<ProfileData>>('/user/profile')
}
// ==================== 教育经历相关 ====================
/** 描述段落 */
export interface DescriptionParagraph {
/** 段落标识,前端生成的短ID */
id?: string
/** 段落文本内容 */
text: string
}
/** 教育经历 — 查询返回数据结构 */
export interface EducationItem {
/** 主键 ID */
id?: number
/** 学校名称 */
school?: string
/** 专业 */
major?: string
/** 学历 1=大专 2=本科 3=硕士 4=博士 */
degree?: number
/** 学习形式 0=全日制 1=非全日制 */
studyType?: number
/** 入学时间,格式:YYYY-MM */
startDate?: string
/** 毕业时间,格式:YYYY-MM */
endDate?: string
/** 描述段落 */
description?: DescriptionParagraph[]
}
/** 教育经历 — 保存请求参数(单条) */
export interface SaveEducationItem {
/** 学校名称 */
school: string
/** 专业 */
major?: string
/** 学历 1=大专 2=本科 3=硕士 4=博士 */
degree: number
/** 学习形式 0=全日制 1=非全日制 */
studyType?: number
/** 入学时间,格式:YYYY-MM */
startDate?: string
/** 毕业时间,格式:YYYY-MM */
endDate?: string
/** 描述段落 */
description?: DescriptionParagraph[]
}
/**
* 获取教育经历列表
* GET /user/profile/education
* Cookie 自动携带身份信息,无需额外传参
*/
export function fetchEducation() {
return request.get<any, ApiResult<EducationItem[]>>('/user/profile/education')
}
/**
* 保存教育经历(全量覆盖)
* POST /user/profile/education
* Body: SaveEducationItem[]
*/
export function saveEducation(data: SaveEducationItem[]) {
return request.post<any, ApiResult>('/user/profile/education', data)
}
// ==================== 工作经历相关 ====================
/** 工作经历 — 查询返回数据结构 */
export interface WorkItem {
/** 主键 ID */
id?: number
/** 公司名称 */
companyName?: string
/** 职位 */
position?: string
/** 开始时间 */
startDate?: string
/** 结束时间 */
endDate?: string
/** 描述段落 */
description?: DescriptionParagraph[]
}
/** 工作经历 — 保存请求参数(单条) */
export interface SaveWorkItem {
/** 公司名称 */
companyName: string
/** 职位 */
position: string
/** 开始时间,格式:2023.06 */
startDate: string
/** 结束时间,格式:2023.09,至今则为空 */
endDate?: string
/** 描述段落 */
description?: DescriptionParagraph[]
}
/**
* 获取工作经历列表
* GET /user/profile/work
*/
export function fetchWork() {
return request.get<any, ApiResult<WorkItem[]>>('/user/profile/work')
}
/**
* 保存工作经历(全量覆盖)
* POST /user/profile/work
* Body: SaveWorkItem[]
*/
export function saveWork(data: SaveWorkItem[]) {
return request.post<any, ApiResult>('/user/profile/work', data)
}
// ==================== 实习经历相关 ====================
// 实习经历字段与工作经历一致,复用 WorkItem / SaveWorkItem 类型
/**
* 获取实习经历列表
* GET /user/profile/internship
*/
export function fetchInternship() {
return request.get<any, ApiResult<WorkItem[]>>('/user/profile/internship')
}
/**
* 保存实习经历(全量覆盖)
* POST /user/profile/internship
* Body: SaveWorkItem[]
*/
export function saveInternship(data: SaveWorkItem[]) {
return request.post<any, ApiResult>('/user/profile/internship', data)
}
// ==================== 项目经历相关 ====================
/** 项目经历 — 查询返回数据结构 */
export interface ProjectItem {
/** 主键 ID */
id?: number
/** 所属公司 */
companyName?: string
/** 项目名称 */
projectName?: string
/** 担任角色 */
role?: string
/** 开始时间 */
startDate?: string
/** 结束时间 */
endDate?: string
/** 描述段落 */
description?: DescriptionParagraph[]
}
/** 项目经历 — 保存请求参数(单条) */
export interface SaveProjectItem {
/** 所属公司 */
companyName?: string
/** 项目名称 */
projectName: string
/** 担任角色 */
role?: string
/** 开始时间,格式:2023.06 */
startDate: string
/** 结束时间,格式:2023.09,至今则为空 */
endDate?: string
/** 描述段落 */
description?: DescriptionParagraph[]
}
/**
* 获取项目经历列表
* GET /user/profile/project
*/
export function fetchProject() {
return request.get<any, ApiResult<ProjectItem[]>>('/user/profile/project')
}
/**
* 保存项目经历(全量覆盖)
* POST /user/profile/project
* Body: SaveProjectItem[]
*/
export function saveProject(data: SaveProjectItem[]) {
return request.post<any, ApiResult>('/user/profile/project', data)
}
// ==================== 竞赛经历相关 ====================
/** 竞赛经历 — 查询返回数据结构 */
export interface CompetitionItem {
/** 主键 ID */
id?: number
/** 竞赛名称 */
competitionName?: string
/** 获奖情况 */
award?: string
/** 获奖时间 */
awardDate?: string
/** 描述段落 */
description?: DescriptionParagraph[]
}
/** 竞赛经历 — 保存请求参数(单条) */
export interface SaveCompetitionItem {
/** 竞赛名称 */
competitionName: string
/** 获奖情况,如全国二等奖 */
award?: string
/** 获奖时间,格式:2023.07 */
awardDate?: string
/** 描述段落 */
description?: DescriptionParagraph[]
}
/**
* 获取竞赛经历列表
* GET /user/profile/competition
*/
export function fetchCompetition() {
return request.get<any, ApiResult<CompetitionItem[]>>('/user/profile/competition')
}
/**
* 保存竞赛经历(全量覆盖)
* POST /user/profile/competition
* Body: SaveCompetitionItem[]
*/
export function saveCompetition(data: SaveCompetitionItem[]) {
return request.post<any, ApiResult>('/user/profile/competition', data)
}