diff --git a/api/api_v1/endpoints/interview.py b/api/api_v1/endpoints/interview.py index cb6303e..613fb00 100644 --- a/api/api_v1/endpoints/interview.py +++ b/api/api_v1/endpoints/interview.py @@ -451,6 +451,17 @@ async def add_job( return schemas.Msg(code=200, msg='ok', data='') +@router.post("/find_job") +async def find_job( + request: Request, + data_in: schemas.Find_job, + db: AsyncIOMotorDatabase = Depends(get_database), +) -> schemas.Msg: + """获取单个职位信息""" + res = await crud.jobs.find_job(db, data_in.job_id) + return schemas.Msg(code=200, msg='ok', data=res) + + @router.post("/condition") async def condition( request: Request, diff --git a/crud/crud_jobs.py b/crud/crud_jobs.py index 7ae4b85..cb800df 100644 --- a/crud/crud_jobs.py +++ b/crud/crud_jobs.py @@ -42,7 +42,7 @@ class CRUDJobs(CRUDBase): # 获取对应jobid的信息 async def find_job(self, db: AsyncIOMotorDatabase, job_id): - return await self.find_one(db, {'job_id': job_id}) + return await self.find_one(db, {'job_id': job_id},{'_id':0}) # 获取对应job_id的部门和名称 async def find_job_name(self, db: AsyncIOMotorDatabase, job_id): diff --git a/liwei_接口文档.md b/liwei_接口文档.md index e691efb..5e56650 100644 --- a/liwei_接口文档.md +++ b/liwei_接口文档.md @@ -321,4 +321,10 @@ api:/api/v1/itr/ins_section #所有的api api:/api/v1/itr/api_list -请求方式:get \ No newline at end of file +请求方式:get + +#获取单个职位信息 +api:/api/v1/itr/find_job +请求方式:post +参数: + job_id: str # 职位的唯一id \ No newline at end of file diff --git a/schemas/jobs.py b/schemas/jobs.py index 32b001d..d704913 100644 --- a/schemas/jobs.py +++ b/schemas/jobs.py @@ -33,6 +33,7 @@ class Job(BaseModel): hr_name: List[dict] # 用人经理 interview: List[dict] # 面试官 + class Jobs(BaseModel): job_id: str = None # 职位的唯一id job_name: str = None # 职位名称 @@ -59,8 +60,8 @@ class Jobs(BaseModel): min_money: int = None # 薪资范围min max_money: int = None # 薪资范围max requirement: str = None # 需求描述 - hr_name: List[dict] =None # 用人经理 - interview: List[str] =None # 面试官 + hr_name: List[dict] = None # 用人经理 + interview: List[str] = None # 面试官 class Ins_Job(BaseModel): @@ -68,26 +69,30 @@ class Ins_Job(BaseModel): job_name: str # 职位名称 job_sector: str # 职位部门 job_nature: int # 职位性质 - job_priority: str =None # 职位优先级 - owner_name: str =None # 渠道 + job_priority: str = None # 职位优先级 + owner_name: str = None # 渠道 principal: List[dict] # 负责人 patronn: List[dict] # 协助人 start_time: str # 开始招聘时间 function_type: str # 职能类型 - filtering_rules: bool=None # 是否使用筛选规则 - hiring_needs: bool =None # 是否关联招聘需求 - auto_repeater: bool =None # 是否自动转发 + filtering_rules: bool = None # 是否使用筛选规则 + hiring_needs: bool = None # 是否关联招聘需求 + auto_repeater: bool = None # 是否自动转发 cacsi_count: int = 0 # 面试满意度反馈次数 - state: bool # 职位招聘状态 + state: bool # 职位招聘状态 job_num: str # 目标招聘人数 now_job_num: int = 0 # 实际招聘人数 education: int # 学历要求 job_rank: str # 职位级别 work_exp: int # 工作经验 - report_obj: str =None # 汇报对象 + report_obj: str = None # 汇报对象 min_money: int # 薪资范围min max_money: int # 薪资范围max requirement: str # 需求描述 hr_name: List[dict] # 用人经理 interview: List[dict] # 面试官 - end_time: str #结束招聘时间 + end_time: str # 结束招聘时间 + + +class Find_job(BaseModel): + job_id: str # 职位的唯一id