feat: 新增批量数据处理脚本并更新考勤脚本配置

- 更新考勤jupyter notebook的登录账号、密码与请求方式
- 新增Dify API调用脚本test.py用于测试对话请求
- 新增database.py实现批量格式化处理教学计划数据并生成更新SQL
This commit is contained in:
2026-06-16 21:00:55 +08:00
parent 2d8c1ea8f9
commit 9fb191884e
4 changed files with 740 additions and 22 deletions
+23 -22
View File
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 3,
"id": "318e7588",
"metadata": {},
"outputs": [],
@@ -13,13 +13,13 @@
"# ip = \"http://192.168.0.244:8100\"\n",
"\n",
"param = {\n",
" \"username\": \"tangchao\",\n",
" \"password\": \"123456a\",\n",
" \"username\": \"xtl\",\n",
" \"password\": \"xia123456\",\n",
" \"client_id\": \"client\",\n",
" \"grant_type\": \"password\",\n",
" \"client_secret\": \"123456\",\n",
"}\n",
"data = get(url=f\"http://band.hxzhxy.cn/oauth/token?username=zhongwei&password=123456a&client_id=client&grant_type=password&client_secret=123456\").json()\n",
"data = get(url=f\"http://band.hxzhxy.cn/oauth/token\",params=param).json()\n",
"token = data[\"access_token\"]\n",
"header = {\n",
" \"content-type\": \"application/json\",\n",
@@ -29,22 +29,10 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"id": "3c046d8d",
"metadata": {},
"outputs": [
{
"ename": "",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[1;31m在当前单元格或上一个单元格中执行代码时 Kernel 崩溃。\n",
"\u001b[1;31m请查看单元格中的代码,以确定故障的可能原因。\n",
"\u001b[1;31m单击<a href='https://aka.ms/vscodeJupyterKernelCrash'>此处</a>了解详细信息。\n",
"\u001b[1;31m有关更多详细信息,请查看 Jupyter <a href='command:jupyter.viewOutput'>log</a>。"
]
}
],
"outputs": [],
"source": [
"for i in range(24,27):\n",
" post(f\"{ip}/classAttendStu/createThisWeek\",headers=header,params={\"planId\":i},timeout=600).text"
@@ -52,16 +40,29 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"id": "343a9e44",
"metadata": {},
"outputs": [],
"source": []
"outputs": [
{
"data": {
"text/plain": [
"'{\"success\":true,\"msg\":\"操作成功\",\"code\":0,\"data\":null}'"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"post(f\"{ip}/classAttendStu/createThisWeek\",headers=header,params={\"planId\":46},timeout=600).text"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},