6. 接口与体验
6.1 开放API
API设计
智能人力资源系统提供RESTful API接口,支持多种HR系统接入:
API架构
基础URL:
https://api.hr-ai.com/v1/hr
核心接口:
1. 简历解析接口(Resume Parsing)
POST /api/v1/resume/parse
Content-Type: multipart/form-data
{
"resume_file": <简历文件>,
"file_type": "pdf",
"language": "zh"
}
Response:
{
"resume_id": "R123456",
"status": "success",
"data": {
"basic_info": {
"name": "张三",
"gender": "男",
"age": 30,
"contact": "13800138000"
},
"education": [
{
"degree": "本科",
"school": "清华大学",
"major": "计算机科学",
"graduation_time": "2015年"
}
],
"work_experience": [
{
"company": "阿里巴巴",
"position": "高级工程师",
"duration": "2015-2020",
"description": "负责核心系统开发"
}
],
"skills": ["Java", "Python", "Spring"]
}
}
2. 人才匹配接口(Talent Matching)
POST /api/v1/talent/match
Content-Type: application/json
{
"resume_id": "R123456",
"job_id": "J789012",
"job_requirements": {
"required_skills": ["Java", "Spring"],
"required_experience": 3,
"required_education": "本科"
}
}
Response:
{
"match_id": "M123456",
"match_score": 85,
"details": {
"skill_match": 90,
"experience_match": 85,
"education_match": 80
},
"reasons": [
"技能匹配度高:Java、Spring等核心技能完全匹配",
"工作经验丰富:5年相关工作经验,超过要求的3年"
],
"recommendations": ["建议进入面试环节"]
}
3. 面试问题生成接口(Interview Question Generation)
POST /api/v1/interview/questions
Content-Type: application/json
{
"resume_id": "R123456",
"job_id": "J789012",
"question_types": ["technical", "behavioral", "situational"]
}
Response:
{
"question_id": "Q123456",
"questions": [
{
"type": "technical",
"question": "请介绍一下Spring框架的核心特性",
"evaluation_points": [
"对Spring框架的理解",
"实际项目经验",
"技术深度"
],
"reference_answer": "Spring框 架的核心特性包括..."
},
{
"type": "behavioral",
"question": "请描述一次你解决复杂技术问题的经历",
"evaluation_points": [
"问题分析能力",
"解决方案设计",
"执行能力"
]
}
]
}
4. 培训推荐接口(Training Recommendation)
POST /api/v1/training/recommend
Content-Type: application/json
{
"employee_id": "E123456",
"job_id": "J789012",
"current_skills": ["Java", "Spring"],
"target_skills": ["微服务", "分布式系统"]
}
Response:
{
"recommendation_id": "TR123456",
"recommended_courses": [
{
"course_id": "C001",
"course_name": "微服务架 构设计",
"match_score": 95,
"reason": "与目标技能高度匹配",
"learning_path": [
"基础课程:微服务概念",
"进阶课程:Spring Cloud实践",
"高级课程:分布式系统设计"
]
}
],
"learning_path": {
"estimated_duration": "3个月",
"courses": ["C001", "C002", "C003"]
}
}
5. 绩效分析接口(Performance Analysis)
POST /api/v1/performance/analyze
Content-Type: application/json
{
"employee_id": "E123456",
"period": "2024-Q1",
"performance_data": {
"work_results": [...],
"360_feedback": [...],
"goal_completion": 85
}
}
Response:
{
"analysis_id": "PA123456",
"overall_score": 85,
"strengths": [
"技术能力强,能够独立解决复杂问题",
"团队协作能力好,能够有效沟通"
],
"weaknesses": [
"项目管理能力需要提升",
"时间管理能力有待加强"
],
"improvement_suggestions": [
"建议参加项目管理培训",
"建议学习时间管理技巧"
],
"performance_report": {
"summary": "...",
"details": {...}
}
}
API认证与授权
认证方式
API Key认证:
Authorization: ApiKey <api_key>
OAuth 2.0认证:
Authorization: Bearer <access_token>
权限控制
基于角色的访问控制(RBAC):
- HR角色:可以访问所有HR相关接口
- 面试官角色:可以访问面试相关接口
- 员工角色:可以访问个人相关接口
- 管理员角色:可以访问所有接口
API限流
限流策略
基于用户的限流:
- 免费用户:100请求/小时
- 标准用户:1000请求/小时
- 企业用户:10000请求/小时
基于接口的限流:
- 简历解析:50请求/分钟
- 人才匹配:100请求/分钟
- 面试问题生成:200请求/分钟