添加引导词和投递模板
This commit is contained in:
@@ -168,6 +168,7 @@ def start_apply_shared(params: dict) -> dict:
|
||||
boss_online_only=bool(params.get("boss_online_only")),
|
||||
daily_limit=int(params.get("daily_limit") or 0),
|
||||
allow_headhunter=bool(params.get("allow_headhunter")),
|
||||
prompt=params.get("prompt"),
|
||||
)
|
||||
return {"ok": True, "msg": "投递任务已启动", "session_id": applicant.session_id}
|
||||
|
||||
@@ -216,6 +217,7 @@ class StartApplyReq(BaseModel):
|
||||
boss_online_only: bool = False
|
||||
daily_limit: int = 0
|
||||
allow_headhunter: bool = False
|
||||
prompt: str | None = None
|
||||
|
||||
|
||||
class ResumeUpdateReq(BaseModel):
|
||||
@@ -488,6 +490,45 @@ def stop_apply():
|
||||
return {"ok": True, "msg": "正在停止投递任务..."}
|
||||
|
||||
|
||||
# =======================================================
|
||||
# 投递条件模板(服务端持久化)
|
||||
# =======================================================
|
||||
@app.get("/api/templates")
|
||||
def list_templates():
|
||||
_require_auth()
|
||||
try:
|
||||
return state.server_api.list_templates()
|
||||
except requests.HTTPError as e:
|
||||
raise HTTPException(status_code=e.response.status_code, detail=_extract_error(e))
|
||||
|
||||
|
||||
@app.post("/api/templates")
|
||||
def create_template(req: dict):
|
||||
_require_auth()
|
||||
try:
|
||||
return state.server_api.create_template(req)
|
||||
except requests.HTTPError as e:
|
||||
raise HTTPException(status_code=e.response.status_code, detail=_extract_error(e))
|
||||
|
||||
|
||||
@app.put("/api/templates/{template_id}")
|
||||
def update_template(template_id: int, req: dict):
|
||||
_require_auth()
|
||||
try:
|
||||
return state.server_api.update_template(template_id, req)
|
||||
except requests.HTTPError as e:
|
||||
raise HTTPException(status_code=e.response.status_code, detail=_extract_error(e))
|
||||
|
||||
|
||||
@app.delete("/api/templates/{template_id}")
|
||||
def delete_template(template_id: int):
|
||||
_require_auth()
|
||||
try:
|
||||
return state.server_api.delete_template(template_id)
|
||||
except requests.HTTPError as e:
|
||||
raise HTTPException(status_code=e.response.status_code, detail=_extract_error(e))
|
||||
|
||||
|
||||
@app.get("/api/apply-status")
|
||||
def apply_status():
|
||||
applicant = state.applicant
|
||||
|
||||
Reference in New Issue
Block a user