修改定制简历保存逻辑
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
"""定制简历接口(查询/修改/回滚)"""
|
||||
|
||||
from fastapi import APIRouter
|
||||
from fastapi import APIRouter, Query
|
||||
|
||||
from app.core.context import RequestContext
|
||||
from app.schemas.customize_resume import CustomizeResume
|
||||
@@ -10,21 +10,21 @@ router = APIRouter(prefix="/job", tags=["定制简历"])
|
||||
|
||||
|
||||
@router.get("/customize-resume", summary="查询定制简历")
|
||||
async def get_customize_resume():
|
||||
"""查询当前用户的定制简历"""
|
||||
async def get_customize_resume(job_id: int = Query(..., description="岗位ID")):
|
||||
"""查询当前用户针对某岗位的定制简历"""
|
||||
user_id = RequestContext.user_id.get()
|
||||
return await customize_resume_store.get(user_id)
|
||||
return await customize_resume_store.get(user_id, job_id)
|
||||
|
||||
|
||||
@router.put("/customize-resume", summary="修改定制简历")
|
||||
async def update_customize_resume(data: CustomizeResume):
|
||||
async def update_customize_resume(job_id: int = Query(..., description="岗位ID"), data: CustomizeResume = ...):
|
||||
"""手动编辑定制简历(整体覆盖)"""
|
||||
user_id = RequestContext.user_id.get()
|
||||
await customize_resume_store.save(user_id, data)
|
||||
await customize_resume_store.save(user_id, job_id, data)
|
||||
|
||||
|
||||
@router.post("/customize-resume/rollback", summary="回滚定制简历")
|
||||
async def rollback_customize_resume():
|
||||
async def rollback_customize_resume(job_id: int = Query(..., description="岗位ID")):
|
||||
"""回滚到上一版本的定制简历"""
|
||||
user_id = RequestContext.user_id.get()
|
||||
await customize_resume_store.rollback(user_id)
|
||||
await customize_resume_store.rollback(user_id, job_id)
|
||||
|
||||
Reference in New Issue
Block a user