feat: 添加多个功能模块和工具脚本

- 新增websocket客户端和服务端实现
- 添加图片压缩工具和快速压缩脚本
- 实现学生信息处理相关API
- 添加MQTT客户端和消息处理功能
- 更新.gitignore忽略更多文件类型
- 添加数据库操作工具和示例
- 实现多个测试脚本和工具类
This commit is contained in:
2026-04-13 14:47:50 +08:00
parent 2cfd7c5a08
commit aac9f5934d
87 changed files with 216279 additions and 6519 deletions
+123
View File
@@ -0,0 +1,123 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "686215f8",
"metadata": {},
"outputs": [],
"source": [
"from requests import get,post\n",
"import time\n",
"ip = \"http://band.hxzhxy.cn\"\n",
"param = {\n",
" \"username\": \"zhongwei\",\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?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",
" \"authorization\": f\"Bearer {token}\",\n",
"}"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "63e34092",
"metadata": {},
"outputs": [],
"source": [
"ids = [36, 56,95,96,146,223,234,331,392,397,398,406,416,419,420]"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "775850cb",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'36&ids=56&ids=95&ids=96&ids=146&ids=223&ids=234&ids=331&ids=392&ids=397&ids=398&ids=406&ids=416&ids=419&ids=420'"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"\"&ids=\".join([str(i) for i in ids])"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "6b68dc63",
"metadata": {},
"outputs": [],
"source": [
"url = 'https://www.hxzhxy.cn/hxyd-api/uc/role/grant/235?ids=36&ids=56&ids=95&ids=96&ids=146&ids=223&ids=234&ids=331&ids=392&ids=397&ids=398&ids=406&ids=416&ids=419&ids=420&access_token=a0db0a6f-0b16-4948-8d8b-4a0b6ab15f90'"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3140ac56",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'success': True, 'msg': '操作成功', 'code': 0, 'data': None}"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
},
{
"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": [
"post(url=url,headers=header).json()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "base",
"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
}