This commit is contained in:
xyj 2023-12-09 15:34:50 +08:00
parent 56beae735b
commit 2d139a039f
1 changed files with 4 additions and 3 deletions

7
api.py
View File

@ -8,7 +8,8 @@ def add(data: LOT_DATA):
add_kb_to_db(data)
return BaseResponse()
except Exception as e:
return BaseResponse(code=500, msg=e)
print(e)
return BaseResponse(code=500, msg=str(e))
def delete(start_time, end_time):
@ -16,7 +17,7 @@ def delete(start_time, end_time):
delete_kb_detail_by_time(start_time, end_time)
return BaseResponse()
except Exception as e:
return BaseResponse(code=500, msg=e)
return BaseResponse(code=500, msg=str(e))
def get_data():
@ -24,4 +25,4 @@ def get_data():
data = get_kb_detail()
return BaseResponse(data=data)
except Exception as e:
return BaseResponse(code=404, msg=e)
return BaseResponse(code=404, msg=str(e))