- 更新考勤jupyter notebook的登录账号、密码与请求方式 - 新增Dify API调用脚本test.py用于测试对话请求 - 新增database.py实现批量格式化处理教学计划数据并生成更新SQL
85 lines
1.9 KiB
Plaintext
85 lines
1.9 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"id": "318e7588",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"from requests import get,post\n",
|
|
"import time\n",
|
|
"ip = \"http://band.hxzhxy.cn\"\n",
|
|
"# ip = \"http://192.168.0.244:8100\"\n",
|
|
"\n",
|
|
"param = {\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\",params=param).json()\n",
|
|
"token = data[\"access_token\"]\n",
|
|
"header = {\n",
|
|
" \"content-type\": \"application/json\",\n",
|
|
" \"authorization\": f\"Bearer {token}\",\n",
|
|
"}"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 4,
|
|
"id": "3c046d8d",
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"for i in range(24,27):\n",
|
|
" post(f\"{ip}/classAttendStu/createThisWeek\",headers=header,params={\"planId\":i},timeout=600).text"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 6,
|
|
"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"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 3",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.12.4"
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 5
|
|
}
|