This commit is contained in:
2026-08-26 14:40:35 +08:00
parent e3280623de
commit ab79dd89be
12 changed files with 56 additions and 54 deletions
+2 -2
View File
@@ -86,8 +86,8 @@ class ApplySession(Base):
status = Column(String(20), default="running", nullable=False)
# 搜索关键词(逗号分隔)
keywords = Column(String(512), nullable=True)
# 城市代码
city_code = Column(String(20), nullable=True)
# 城市
city = Column(String(20), nullable=True)
# 薪资范围
salary_min = Column(Integer, nullable=True)
salary_max = Column(Integer, nullable=True)
+2 -2
View File
@@ -89,8 +89,8 @@ def create_task(
if req.task_type == "start_apply":
params = req.params or {}
if not params.get("keywords") or not params.get("city_code"):
raise HTTPException(status_code=422, detail="开始投递必须提供 keywords 与 city_code")
if not params.get("keywords") or not params.get("city"):
raise HTTPException(status_code=422, detail="开始投递必须提供 keywords 与 city")
task = RpaTask(
user_id=current_user.id,
+1 -1
View File
@@ -34,7 +34,7 @@ def start_session(
user_id=current_user.id,
status="running",
keywords=req.keywords,
city_code=req.city_code,
city=req.city,
salary_min=req.salary_min,
salary_max=req.salary_max,
)
+2 -2
View File
@@ -94,7 +94,7 @@ class ResumeUpdateIn(BaseModel):
# =======================================================
class SessionStartIn(BaseModel):
keywords: str
city_code: str
city: str
salary_min: Optional[int] = None
salary_max: Optional[int] = None
@@ -103,7 +103,7 @@ class SessionOut(BaseModel):
id: int
status: str
keywords: Optional[str]
city_code: Optional[str]
city: Optional[str]
salary_min: Optional[int]
salary_max: Optional[int]
applied_count: int
+24 -10
View File
@@ -198,13 +198,26 @@
</div>
<div class="bl-tip" id="rsDetail">进度:- | 更新:-</div>
<div class="bl-add" style="flex-wrap:wrap;">
<input type="text" id="rKeywords" placeholder="搜索关键词,多个用逗号分隔,如:java,后端" style="flex:2;min-width:220px;">
<input type="text" id="rCity" placeholder="城市码(如 101010100=北京)" style="flex:1;min-width:150px;">
<input type="number" id="rScore" placeholder="及格分" value="65" style="width:80px;">
<input type="number" id="rLimit" placeholder="每日上限(0不限)" value="0" style="width:130px;">
<label style="display:flex;align-items:center;gap:4px;font-size:13px;"><input type="checkbox" id="rOnlineOnly"> 只投在线Boss</label>
<label style="display:flex;align-items:center;gap:4px;font-size:13px;"><input type="checkbox" id="rHunter"> 考虑猎头</label>
<div class="bl-add" style="flex-wrap:wrap;align-items:flex-end;">
<div style="flex:2;min-width:220px;"><label style="font-size:12px;color:#666;">搜索关键词(多个用逗号分隔)</label>
<input type="text" id="rKeywords" placeholder="如:Python开发,后端工程师" value="Python开发"></div>
<div style="min-width:110px;"><label style="font-size:12px;color:#666;">城市</label>
<select id="rCity" style="width:100%;padding:9px 10px;border:1px solid #d9d9d9;border-radius:6px;">
<option value="北京">北京</option><option value="上海">上海</option>
<option value="广州">广州</option><option value="深圳">深圳</option>
<option value="杭州">杭州</option><option value="成都">成都</option>
<option value="西安">西安</option><option value="济南">济南</option>
</select></div>
<div style="width:110px;"><label style="font-size:12px;color:#666;">AI 最低匹配分</label>
<input type="number" id="rScore" value="65" min="0" max="100"></div>
<div style="width:100px;"><label style="font-size:12px;color:#666;">最低薪资 (K)</label>
<input type="number" id="rSalaryMin" value="15" min="0"></div>
<div style="width:100px;"><label style="font-size:12px;color:#666;">最高薪资 (K)</label>
<input type="number" id="rSalaryMax" value="40" min="0"></div>
<div style="width:140px;"><label style="font-size:12px;color:#666;">每日投递上限(0=不限)</label>
<input type="number" id="rLimit" value="30" min="0"></div>
<label style="display:flex;align-items:center;gap:4px;font-size:13px;padding-bottom:10px;"><input type="checkbox" id="rOnlineOnly"> 只投递 Boss 在线的</label>
<label style="display:flex;align-items:center;gap:4px;font-size:13px;padding-bottom:10px;"><input type="checkbox" id="rHunter"> 考虑猎头职位</label>
<button id="btnStartRemote" style="background:#1890ff;">开始投递</button>
<button id="btnStopRemote">结束投递</button>
</div>
@@ -479,13 +492,14 @@ document.getElementById('blNext').onclick = () => { blState.page++; loadBlacklis
// 远程控制
document.getElementById('btnStartRemote').onclick = () => {
const keywords = (document.getElementById('rKeywords').value || '').split(/[,,\s]+/).filter(Boolean);
const cityCode = (document.getElementById('rCity').value || '').trim();
if (!keywords.length) { alert('请填写搜索关键词'); return; }
if (!cityCode) { alert('请填写城市码'); return; }
if (!confirm('确认远程启动投递任务?')) return;
sendTask('start_apply', {
keywords, city_code: cityCode,
keywords,
city: document.getElementById('rCity').value,
min_score: parseInt(document.getElementById('rScore').value, 10) || 65,
salary_min: parseInt(document.getElementById('rSalaryMin').value, 10) || 0,
salary_max: parseInt(document.getElementById('rSalaryMax').value, 10) || 0,
daily_limit: parseInt(document.getElementById('rLimit').value, 10) || 0,
boss_online_only: document.getElementById('rOnlineOnly').checked,
allow_headhunter: document.getElementById('rHunter').checked,