haha
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
数据库初始化脚本:创建测试数据
|
||||
用于测试新增的筛选和复聊功能
|
||||
用于测试招聘回复与复聊功能
|
||||
"""
|
||||
|
||||
import os
|
||||
@@ -13,36 +13,7 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'server.settings')
|
||||
django.setup()
|
||||
|
||||
from server.models import FilterConfig, ChatScript
|
||||
|
||||
|
||||
def create_filter_config():
|
||||
"""创建筛选配置示例"""
|
||||
print("创建筛选配置...")
|
||||
|
||||
# 删除旧的测试配置
|
||||
FilterConfig.objects.filter(name__contains="测试").delete()
|
||||
|
||||
# 创建新配置
|
||||
config = FilterConfig.objects.create(
|
||||
name="Python开发筛选配置",
|
||||
age_min=22,
|
||||
age_max=35,
|
||||
gender="不限",
|
||||
education="本科",
|
||||
activity="3天内活跃",
|
||||
positions=["Python开发", "后端开发", "全栈开发", "Django开发"],
|
||||
greeting_min=5,
|
||||
greeting_max=20,
|
||||
rest_minutes=30,
|
||||
collection_min=10,
|
||||
collection_max=50,
|
||||
message_interval=30,
|
||||
is_active=True
|
||||
)
|
||||
print(f"✓ 创建筛选配置: {config.name} (ID: {config.id})")
|
||||
|
||||
return config
|
||||
from server.models import ChatScript
|
||||
|
||||
|
||||
def create_chat_scripts():
|
||||
@@ -106,21 +77,12 @@ def main():
|
||||
print("=" * 60)
|
||||
|
||||
try:
|
||||
# 创建筛选配置
|
||||
config = create_filter_config()
|
||||
|
||||
# 创建话术
|
||||
scripts = create_chat_scripts()
|
||||
|
||||
print("\n" + "=" * 60)
|
||||
print("初始化完成!")
|
||||
print("=" * 60)
|
||||
print(f"\n筛选配置: {config.name}")
|
||||
print(f" - 年龄: {config.age_min}-{config.age_max}岁")
|
||||
print(f" - 学历: {config.education}及以上")
|
||||
print(f" - 活跃度: {config.activity}")
|
||||
print(f" - 期望职位: {', '.join(config.positions)}")
|
||||
|
||||
print(f"\n话术配置: 共 {len(scripts)} 条")
|
||||
for script in scripts:
|
||||
print(f" - {script.position} / {script.get_script_type_display()}")
|
||||
|
||||
Reference in New Issue
Block a user