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
+125
View File
@@ -0,0 +1,125 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "70c9ccec",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"os.add_dll_directory(os.getcwd())\n",
"from pctoken import get_token\n",
"from requests import get,post"
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "379f4db2",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"342e75d2-dd64-4d6b-9316-da51fdce642d\n"
]
}
],
"source": [
"BASE_URL = \"http://192.168.0.244:9999\"\n",
"data = get_token(BASE_URL, \"admin\", \"123456\")\n",
"TOKEN = data.get(\"access_token\", \"\")\n",
"print(TOKEN)\n",
"headers = {\n",
" \"Authorization\": f\"Bearer {TOKEN}\",\n",
" \"hx-client\": \"hongxapp\",\n",
"}"
]
},
{
"cell_type": "code",
"execution_count": 31,
"id": "820f6d23",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'{\"timestamp\":\"2026-02-27 15:36:51\",\"status\":500,\"error\":\"Internal Server Error\",\"path\":\"/videoInfoStream/page\"}'"
]
},
"execution_count": 31,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"headers = {\n",
" \"Authorization\": f\"Bearer {TOKEN}\",\n",
" \"HX-CLIENT\": \"hongxapp\",\n",
" 'H-SV-CODE':'video',\n",
" 'Host': '192.168.0.111:5173',\n",
" 'Referer': 'http://192.168.0.111:5173/'\n",
"}\n",
"get( \" http://192.168.0.244:9999/video/videoInfoStream/page?current=1&size=10&descs=&ascs=\",headers=headers).text"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2c7227e6",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'{\"timestamp\":\"2026-02-27 15:34:24\",\"status\":500,\"error\":\"Internal Server Error\",\"path\":\"/podPhoto/pageInfoBySections\"}'"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "1822efb2",
"metadata": {},
"outputs": [],
"source": [
" # \"Accept\": 'application/json, text/plain, */*',\n",
"# 'Connection': 'keep-alive',\n",
"# 'H-SV-CODE':'video',\n",
"# 'HX-CLIENT':'hongxapp',\n",
"# 'Host': '192.168.0.111:5173',\n",
"# 'Referer': 'http://192.168.0.111:5173/'"
]
}
],
"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
}