diff --git a/api/api_v1/endpoints/interview.py b/api/api_v1/endpoints/interview.py index 6defae8..cc51772 100644 --- a/api/api_v1/endpoints/interview.py +++ b/api/api_v1/endpoints/interview.py @@ -40,6 +40,8 @@ async def interview_find( res = interview.find_interview_sql() sql = res['sql'] data = await db.execute(sql) + if not data: + return schemas.Msg(code=-9, msg='无数据', data=None) return schemas.Msg(code=200, msg='ok', data=data) @@ -54,7 +56,10 @@ async def interview_update( await interview.init() res = interview.update_interview_sql() sql = res['sql'] - data = await db.execute(sql) + try: + data = await db.execute(sql) + except: + return schemas.Msg(code=-9, msg='数据有误', data=None) return schemas.Msg(code=200, msg='ok', data=data) diff --git a/core/config.py b/core/config.py index 0abd1f4..5e2b1e4 100644 --- a/core/config.py +++ b/core/config.py @@ -24,9 +24,15 @@ class Settings(BaseSettings): ACCESS_TOKEN_EXPIRE_MINUTES: int = 60 * 24 * 8 SECRET_KEY: str = 'ZaFX6EypK6PtuhGv11q4DLRvAb0csiLx4dbKUwLwCe8' + REDIS_CONF = { + 'host': '127.0.0.1', + 'port': 6379, + 'db': 1, + 'decode_responses': 'utf-8', + } CK_CONFIG = {'host': '10.0.1.111', - 'port': 8123, + 'port': 9000, 'user': 'default', 'password': '498588' } @@ -44,7 +50,7 @@ class Settings(BaseSettings): 'in': lambda col, *val: col.in_(val[0]), 'not in': lambda col, *val: col.notin_(val[0]), '!=': lambda col, *val: col != val[0], - 'range': lambda col, *val: and_(col >= val[0], col < val[1]) + 'range': lambda col, *val: and_(col >= val[0], col < val[1]) } @@ -212,7 +218,7 @@ class Settings(BaseSettings): }, { 'id': 'in', 'title': '条件多选' - #'title': '在列表里' + # 'title': '在列表里' }, # { # 'id': 'regex', @@ -298,7 +304,7 @@ class Settings(BaseSettings): '-': lambda x, y: x - y, '*': lambda x, y: x * y, '/': lambda x, y: x / y, - #'%': lambda x, y:(x)-int(x/y)*(y) 取模用 + # '%': lambda x, y:(x)-int(x/y)*(y) 取模用 } PROPHET_TIME_GRAIN_MAP = { @@ -393,7 +399,7 @@ class Settings(BaseSettings): # MDB_DB: str = 'hr_system' # # DATABASE_URI = f'mongodb://{MDB_USER}:{MDB_PASSWORD}@{MDB_HOST}:{MDB_PORT}/admin' -#本地MongoDB的库测试 +# 本地MongoDB的库测试 class Debug(Settings): MDB_HOST: str = '127.0.0.1' MDB_PORT: int = 27017 @@ -401,6 +407,7 @@ class Debug(Settings): DATABASE_URI = f'mongodb://{MDB_HOST}:{MDB_PORT}/admin' + class Produce(Settings): MDB_HOST: str = '127.0.0.1' MDB_PORT: int = 27017 diff --git a/models/interview_zsgc.py b/models/interview_zsgc.py index 58b15ff..d069369 100644 --- a/models/interview_zsgc.py +++ b/models/interview_zsgc.py @@ -57,12 +57,12 @@ class InterviewDo: if isinstance(value, str): updateStr += str(key) + ' = ' + "'" + value + "'" + ' ' continue - updateStr += str(key) + ' = ' + value + ' ' + updateStr += str(key) + ' = ' + str(value) + ' ' for key, value in self.where.items(): if isinstance(value, str): whereStr += str(key) + ' = ' + "'" + value + "'" + ' ' continue - whereStr += str(key) + ' = ' + value + ' ' + whereStr += str(key) + ' = ' + str(value) + ' ' updateStr.strip() whereStr.strip() sql = f"alter table HR.resumes update {updateStr} where {whereStr}" @@ -80,7 +80,7 @@ class InterviewDo: if isinstance(value, str): whereStr += str(key) + ' = ' + "'" + value + "'" + ' ' continue - whereStr += str(key) + ' = ' + value + ' ' + whereStr += str(key) + ' = ' + str(value) + ' ' whereStr = whereStr.strip() findStr = findStr.strip().strip(',') # sql = f"select {findStr} from HR.resumes where {whereStr}" diff --git a/接口文档/__init__.py b/接口文档/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/接口文档/主页查询接口 b/接口文档/主页查询接口 new file mode 100644 index 0000000..38215ca --- /dev/null +++ b/接口文档/主页查询接口 @@ -0,0 +1,49 @@ +路由: /api/v1/itr/interview_find + +参数: +{ + "data_in": "string", # 任意类型 [修改数据和插入数据时需要使用] + "interview_query": {"interview_stage": 1}, # 查询条件dict类型 + "find_column": [ # 需要查询的字段list包str + "name" + ] +} + + +返回值: +{ + "code": 200, + "msg": "ok", + "data": { + "0": { + "interview_name": "张三", # 面试官 + "interview_type": 0, # 面试类型 0:线上面试,1:线下面试 + "interview_sign": 1, # 面试签到 1:已签到,0:未签到 + "feedback": 0, # 面试反馈 1:已反馈,0:未反馈 + "interview_round": 1, # 面试阶段 1:初试,2:复试,3:终试 + "star_time": "2022-07-11T10:30:00", # 面试开始时间 + "end_time": "2022-07-11T11:00:00", # 面试结束时间 + "event_time": "2022-07-01T10:00:00", # 简历投递时间 + "uid": "123456789", # 唯一id + "name": "李四", # 面试者姓名 + "phone": "13789923799", # 手机号 + "job_name": "python开发", # 应聘职位 + "hr_name": "王五", # 面试负责人 候选人所有者 + "work_exp": "2年", # 工作经验 + "interview_stage": 1, # 简历阶段 1:初筛 2:复筛 3:面试 4:沟通offer 5:待入职 + "owner_name": 2, # 简历来源 1:前程无忧,2:人才库,3:智联招聘,4:Boss直聘,5:58同城 + "education": 1, # 学历 1:大专,2:本科,3:研究生,4:博士,5:硕士 + "work_undergo": "", # 工作经历 + "school": "武汉大学", # 毕业院校 + "specialty": "计算机专业", # 专业 + "mmended_state": 0, # 推荐状态 + "mail": "250213000@qq.com", # 邮箱 + "account": "湖北武汉", # 所在地 + "id_card": "421202199986750339", # 身份证号 + "gender": "男", # 性别 + "interview_state": 2, # 当前面试状态 1:待安排 2:面试中 3:已结束 + "graduate_time": "2022-07-01T08:00:00", # 毕业时间 + "counts": 1 # 第几次投递简历 + } + } +} \ No newline at end of file