新增批量
This commit is contained in:
72
test_user_case.php
Normal file
72
test_user_case.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
// 测试用户提供的数据
|
||||
|
||||
require __DIR__ . '/vendor/autoload.php';
|
||||
|
||||
$position = [
|
||||
"id" => 1,
|
||||
"base_info" => [
|
||||
"岗位名称" => "人工智能与大数据侦察职位一",
|
||||
"招考单位" => "市级公安机关",
|
||||
"招录人数" => "10",
|
||||
"岗位代码" => "45150001"
|
||||
],
|
||||
"position_info" => [
|
||||
"岗位名称" => "人工智能与大数据侦察职位一",
|
||||
"招考单位" => "市级公安机关",
|
||||
"招录人数" => "10",
|
||||
"岗位代码" => "45150001"
|
||||
],
|
||||
"position_require" => [
|
||||
"学历要求" => "本科及以上",
|
||||
"学位要求" => "学士及以上",
|
||||
"年龄要求" => "18周岁以上、35周岁以下。",
|
||||
"专业(学科)类别" => "计算机科学与技术类,电气、电子及自动化类",
|
||||
"其他资格条件" => "适合男性。符合人民警察录用条件。",
|
||||
"专业资格条件" => "曾参加人工智能、大数据、计算机领域竞赛,获个人三等奖或团体三等奖及以上。"
|
||||
]
|
||||
];
|
||||
|
||||
$resume = [
|
||||
"user_id" => 527,
|
||||
"birth_date" => "1995-03-01",
|
||||
"gender" => "男",
|
||||
"work_experience" => "3年基层工作年限",
|
||||
"education" => [
|
||||
[
|
||||
"education_level" => "本科",
|
||||
"degree" => "学士",
|
||||
"majors_name" => "计算机科学与技术"
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
// 加载ThinkPHP框架
|
||||
$app = new think\App();
|
||||
$app->initialize();
|
||||
|
||||
// 创建匹配服务实例
|
||||
$matchService = new app\service\MatchService();
|
||||
|
||||
// 计算匹配度
|
||||
$score = $matchService->calculateMatchScore($position, $resume);
|
||||
|
||||
echo "========================================\n";
|
||||
echo "测试结果\n";
|
||||
echo "========================================\n";
|
||||
echo "匹配度分数: {$score}/100分\n";
|
||||
echo "\n";
|
||||
|
||||
// 检查硬性条件
|
||||
echo "检查硬性条件:\n";
|
||||
echo "- 学历: " . $resume['education'][0]['education_level'] . "\n";
|
||||
echo "- 学位: " . $resume['education'][0]['degree'] . "\n";
|
||||
echo "- 专业: " . $resume['education'][0]['majors_name'] . "\n";
|
||||
$age = date('Y') - date('Y', strtotime($resume['birth_date']));
|
||||
if (date('md') < date('md', strtotime($resume['birth_date']))) {
|
||||
$age--;
|
||||
}
|
||||
echo "- 年龄: {$age}岁\n";
|
||||
echo "- 性别: " . $resume['gender'] . "\n";
|
||||
echo "========================================\n";
|
||||
|
||||
Reference in New Issue
Block a user