Refactor Chat API (#2804)

### What problem does this PR solve?

Refactor Chat API

### Type of change

- [x] Refactoring

---------

Co-authored-by: liuhua <10215101452@stu.ecun.edu.cn>
This commit is contained in:
liuhua
2024-10-12 13:48:43 +08:00
committed by GitHub
parent 2a86472b88
commit a20b82092f
14 changed files with 883 additions and 652 deletions

View File

@ -279,8 +279,8 @@ def get_result(retcode=RetCode.SUCCESS, retmsg='error', data=None):
response = {"code": retcode, "message": retmsg}
return jsonify(response)
def get_error_data_result(retcode=RetCode.DATA_ERROR,
retmsg='Sorry! Data missing!'):
def get_error_data_result(retmsg='Sorry! Data missing!',retcode=RetCode.DATA_ERROR,
):
import re
result_dict = {
"code": retcode,
@ -295,5 +295,4 @@ def get_error_data_result(retcode=RetCode.DATA_ERROR,
continue
else:
response[key] = value
return jsonify(response)
return jsonify(response)