1.添加权限

This commit is contained in:
李伟 2022-09-07 17:53:51 +08:00
parent 2307b5db23
commit cd8dfea5b9
4 changed files with 43 additions and 2 deletions

View File

@ -1681,3 +1681,24 @@ async def add_role_domain(
# 存在则在这个用户表示已经有权限 # 存在则在这个用户表示已经有权限
else: else:
return schemas.Msg(code=-9, msg='权限已存在', data='') return schemas.Msg(code=-9, msg='权限已存在', data='')
@router.post("/send_interviewee")
async def send_interviewee(
request: Request,
data_in: schemas.send_in,
db: AsyncIOMotorDatabase = Depends(get_database),
ckdb: CKDrive = Depends(get_ck_db),
current_user: schemas.UserDB = Depends(deps.get_current_user)
) -> schemas.Msg:
"""一键推送给用人部门"""
up_da = data_in.push
up_list = await crud.user.get_users(db, up_da)
up_da_str = ','.join(up_da)
interview_name = [i['name'] for i in up_list] # 分配的面试官的名字
interview_str = ','.join(interview_name)
sql = f"""
ALTER TABLE HR.resumes update interview_name = '{interview_str}',interview_id = '{up_da_str}' WHERE uid = '{data_in.uid}'
"""
await ckdb.execute(sql) # 初次分配面试官
return schemas.Msg(code=200, msg='ok', data='')

View File

@ -25,6 +25,10 @@ class CRUDUser(CRUDBase):
async def get_user(self, db: AsyncIOMotorDatabase, user_id: str): async def get_user(self, db: AsyncIOMotorDatabase, user_id: str):
res = await db[self.coll_name].find_one({'user_id': user_id}) res = await db[self.coll_name].find_one({'user_id': user_id})
return res return res
#获取用户信息list
async def get_users(self, db: AsyncIOMotorDatabase, user_id: list):
res = await db[self.coll_name].find_many({'user_id':{'$in': user_id}}, {'name': 1,'user_id':1})
return res
async def edit_profile(self, db: AsyncIOMotorDatabase, data_id: schemas.UserProfileEdit, user_id): async def edit_profile(self, db: AsyncIOMotorDatabase, data_id: schemas.UserProfileEdit, user_id):
if data_id.nickname: if data_id.nickname:

View File

@ -328,3 +328,12 @@ api:/api/v1/itr/find_job
请求方式post 请求方式post
参数: 参数:
job_id: str # 职位的唯一id job_id: str # 职位的唯一id
#一键推送给用人部门
api:/api/v1/itr/send_interviewee
请求方式post
参数:
uid: str # 求职者uid
push: List[str] # 推送
content: str # 备注内容
bcc: List[str] # 抄送

View File

@ -137,3 +137,10 @@ class ExtendendOAuth(OAuth2PasswordRequestForm):
super().__init__(grant_type, username, password, scope, client_id, client_secret) super().__init__(grant_type, username, password, scope, client_id, client_secret)
self.unionid = unionid # 通过钉钉扫码获取的unionid self.unionid = unionid # 通过钉钉扫码获取的unionid
# unionid :str # 通过钉钉扫码获取的unionid # unionid :str # 通过钉钉扫码获取的unionid
class send_in(BaseModel):
uid: str # 求职者uid
push: List[str] # 推送
content: str # 备注内容
bcc: List[str] # 抄送