0% found this document useful (0 votes)
9 views5 pages

Postman Guide213123123

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 5

Hướng dẫn Test CV-Job Matching API trên Postman

Cài đặt và chuẩn bị


1. Khởi động server:
python main.py

Server sẽ chạy tại: http://localhost:5000


2. Chuẩn bị Postman:
- Tạo collection mới: "CV-Job Matching API"
- Import hoặc tạo mới các requests

Các Endpoints và Cách Test


1. Health Check
GET http://localhost:5000/health

- Method: GET
- No body required
- Expected Response:
{
"status": "healthy",
"model": "loaded",
"device": "cuda",
"stored_data": {
"has_cv": false,
"has_job": false
}
}

2. Upload CV
POST http://localhost:5000/upload_cv/

Headers:
Content-Type: application/json

Body (raw JSON):


{
"Data": [
{
"personal": {
"contact": [
"+84 938975146"
],
"email": [
"example@gmail.com"
],
"github": [
"https://github.com/example"
],
"linkedin": [
"https://www.linkedin.com/in/example/"
],
"location": [
"Ho Chi Minh City"
],
"name": [
"Example Name"
]
},
"professional": {
"education": [
{
"qualification": [
"Bachelor of Science in Computer Science"
],
"university": [
"Example University"
]
}
],
"experience": [
{
"company": [
"Example Company"
],
"project_experience": [
"Developed various software projects"
],
"role": [
"Software Developer"
],
"years": [
"2"
]
}
],
"technical_skills": [
"Python",
"JavaScript",
"React"
],
"non_technical_skills": [
"Problem Solving",
"Communication"
],
"tools": [
"Git",
"VS Code"
]
}
}
],
"success": true
}

3. Upload Job
POST http://localhost:5000/upload_job/

Headers:
Content-Type: application/json

Body (raw JSON):


{
"id": 1,
"jobTitle": "Senior Software Developer",
"jobDescription": "We are looking for an experienced software developer...",
"experienceRequired": 2,
"qualificationRequired": "Bachelor's degree in Computer Science or related
field",
"skillSets": [
"Python",
"JavaScript",
"React"
],
"companyName": "Example Corp",
"jobType": {
"id": 1,
"name": "Full Time",
"description": "Full Time Position"
}
}

4. Analyze Match
POST http://localhost:5000/analyze_match/

- No body required
- Must have both CV and Job data uploaded first
- Expected Response:
{
"success": true,
"processing_time": 0.12,
"device_used": "cuda",
"match_details": {
"job_id": 1,
"job_title": "Senior Software Developer",
"candidate_name": "Example Name",
"candidate_email": "example@gmail.com",
"scores": {
"overall_match": 85.5,
"skill_match": 90.0,
"experience_match": 100.0,
"content_similarity": 70.2
},
"skill_analysis": {
"matching_skills": ["python", "javascript", "react"],
"missing_skills": [],
"additional_skills": ["git", "vs code"]
},
"experience_analysis": {
"required_years": 2.0,
"candidate_years": 2.0,
"meets_requirement": true
},
"recommendation": {
"category": "Strong Match",
"action": "Highly Recommended for Interview"
}
}
}

5. Clear Data
DELETE http://localhost:5000/clear_data/

- No body required
- Clears stored CV and Job data
- Use before starting new matching process

Quy trình Test Hoàn Chỉnh


1. Kiểm tra health check để đảm bảo server hoạt động
2. Clear data nếu có dữ liệu cũ
3. Upload CV data
4. Upload Job data
5. Verify stored data bằng health check
6. Run analyze match
7. Check kết quả matching

Tips khi Test


1. Error Handling:
- Thử upload CV/Job với data không hợp lệ
- Test analyze match khi chưa có đủ data
- Kiểm tra response khi có lỗi
2. Data Validation:
- Đảm bảo format JSON chính xác
- Check required fields trong CV và Job data
- Verify skill names và format
3. Performance Testing:
- Monitor processing time trong response
- Test với CV và Job có nhiều skills khác nhau
- Verify GPU usage qua device_used field

Common Issues
1. 400 Bad Request:
- Check JSON format
- Verify required fields
- Ensure data types correct
2. 500 Internal Server Error:
- Check server logs
- Verify database connection
- Check model loading status
3. Matching Issues:
- Verify skill names match exactly
- Check experience format
- Ensure text fields properly formatted

You might also like