chore: 批量更新脚本与数据处理优化
1. 调整database.py批量处理记录数为400 2. 新增convert_available.py用于将available字段的JSON数组格式转换为逗号分隔字符串 3. 更新test.py为数据库查询导出脚本 4. 生成并更新SQL更新语句文件 5. 修正jupyter notebook中的数据库连接配置与代码逻辑
This commit is contained in:
+23
-24
@@ -2,7 +2,7 @@
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 3,
|
||||
"execution_count": 1,
|
||||
"id": "318e7588",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -13,13 +13,13 @@
|
||||
"# ip = \"http://192.168.0.244:8100\"\n",
|
||||
"\n",
|
||||
"param = {\n",
|
||||
" \"username\": \"xtl\",\n",
|
||||
" \"password\": \"xia123456\",\n",
|
||||
" \"username\": \"tangchao\",\n",
|
||||
" \"password\": \"123456a\",\n",
|
||||
" \"client_id\": \"client\",\n",
|
||||
" \"grant_type\": \"password\",\n",
|
||||
" \"client_secret\": \"123456\",\n",
|
||||
"}\n",
|
||||
"data = get(url=f\"http://band.hxzhxy.cn/oauth/token\",params=param).json()\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",
|
||||
"token = data[\"access_token\"]\n",
|
||||
"header = {\n",
|
||||
" \"content-type\": \"application/json\",\n",
|
||||
@@ -29,10 +29,22 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 4,
|
||||
"execution_count": null,
|
||||
"id": "3c046d8d",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"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>。"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"for i in range(24,27):\n",
|
||||
" post(f\"{ip}/classAttendStu/createThisWeek\",headers=header,params={\"planId\":i},timeout=600).text"
|
||||
@@ -40,29 +52,16 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 6,
|
||||
"execution_count": null,
|
||||
"id": "343a9e44",
|
||||
"metadata": {},
|
||||
"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"
|
||||
]
|
||||
"outputs": [],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "base",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
@@ -76,7 +75,7 @@
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.12.4"
|
||||
"version": "3.12.1"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
||||
Reference in New Issue
Block a user