feat: 添加多个功能模块和工具脚本
- 新增websocket客户端和服务端实现 - 添加图片压缩工具和快速压缩脚本 - 实现学生信息处理相关API - 添加MQTT客户端和消息处理功能 - 更新.gitignore忽略更多文件类型 - 添加数据库操作工具和示例 - 实现多个测试脚本和工具类
This commit is contained in:
+90
-71
@@ -9,9 +9,10 @@
|
||||
"source": [
|
||||
"from requests import get,post\n",
|
||||
"import time\n",
|
||||
"import json\n",
|
||||
"ip = \"http://band.hxzhxy.cn\"\n",
|
||||
"param = {\n",
|
||||
" \"username\": \"tangchao\",\n",
|
||||
" \"username\": \"zhongwei\",\n",
|
||||
" \"password\": \"123456a\",\n",
|
||||
" \"client_id\": \"client\",\n",
|
||||
" \"grant_type\": \"password\",\n",
|
||||
@@ -22,14 +23,62 @@
|
||||
"header = {\n",
|
||||
" \"content-type\": \"application/json\",\n",
|
||||
" \"authorization\": f\"Bearer {token}\",\n",
|
||||
"}\n",
|
||||
"teamId=110"
|
||||
"}\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "87b0a73c",
|
||||
"execution_count": 30,
|
||||
"id": "e4f5ed31",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"9e6e0e24-67fd-4b7c-802a-b204ff4ca95c\n",
|
||||
"{'success': True, 'msg': '操作成功', 'code': 0, 'data': {'id': 475, 'pwd': '{bcrypt}$2a$10$K7EdytUGmdkfGn.zvLlg3O62TV5hCptj83MGbweHK0jSw8kzZPZ2m', 'locked': False, 'enabled': True, 'role': {'id': 168, 'roleName': '鸿兴演示中学家长', 'description': None, 'priority': 10, 'createTime': 1622713421000, 'updateTime': 1659193585000, 'teamId': 106, 'type': 1}, 'teamId': 106, 'type': 3, 'authorities': [{'authority': '鸿兴演示中学家长'}], 'username': 'jz97621', 'password': '{bcrypt}$2a$10$K7EdytUGmdkfGn.zvLlg3O62TV5hCptj83MGbweHK0jSw8kzZPZ2m', 'accountNonExpired': True, 'accountNonLocked': True, 'credentialsNonExpired': True}}\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"param={\n",
|
||||
" \"username\": 17307283669,\n",
|
||||
" \"password\": \"jz97621\",\n",
|
||||
" \"client_id\": \"client\",\n",
|
||||
" \"grant_type\": \"password\",\n",
|
||||
" \"client_secret\": \"123456\",\n",
|
||||
" \"login_type\": \"PHONE_USERNAME\"\n",
|
||||
"}\n",
|
||||
"token = get(\"https://band.hxzhxy.cn/oauth/token\",params=param).json()[\"access_token\"]\n",
|
||||
"print(token)\n",
|
||||
"data = get(f\"https://band.hxzhxy.cn/uc/account/current?access_token={token}\").json()\n",
|
||||
"print(data)\n"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 33,
|
||||
"id": "b9c253b1",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"fab765b1-46f0-4e2a-816b-ebdeb9d31cdf\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"access_token=get(\"https://band.hxzhxy.cn/oauth/token?username=17307283669&password=2019240217HXYSZX&client_id=client&grant_type=password&client_secret=123456&login_type=PHONE_USERNAME\").json()[\"access_token\"]\n",
|
||||
"print(access_token)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 32,
|
||||
"id": "9136ed38",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
@@ -38,90 +87,60 @@
|
||||
"{'success': True,\n",
|
||||
" 'msg': '操作成功',\n",
|
||||
" 'code': 0,\n",
|
||||
" 'data': {'id': 10914,\n",
|
||||
" 'stuNo': '25040057',\n",
|
||||
" 'stuName': '冯梓骏',\n",
|
||||
" 'sex': 1,\n",
|
||||
" 'classId': 499,\n",
|
||||
" 'gradeId': 129,\n",
|
||||
" 'seralNo': '3108683745',\n",
|
||||
" 'score': 'A',\n",
|
||||
" 'moralEducation': 'A',\n",
|
||||
" 'userName': '25040057CDSPTSZXBRFX',\n",
|
||||
" 'teamId': 110,\n",
|
||||
" 'pid': None,\n",
|
||||
" 'phone': None,\n",
|
||||
" 'imgUrl': None,\n",
|
||||
" 'openid': None,\n",
|
||||
" 'boarder': 2,\n",
|
||||
" 'wxPhone': '13540808459',\n",
|
||||
" 'trust': 0,\n",
|
||||
" 'userId': None,\n",
|
||||
" 'stature': None,\n",
|
||||
" 'weight': None,\n",
|
||||
" 'wxPhones': None,\n",
|
||||
" 'userIdse': None,\n",
|
||||
" 'payUserId': '25082816140601002478',\n",
|
||||
" 'payState': 3,\n",
|
||||
" 'teaChild': 0,\n",
|
||||
" 'openids': None,\n",
|
||||
" 'casId': None,\n",
|
||||
" 'board': 1,\n",
|
||||
" 'chatOpenId': None,\n",
|
||||
" 'chatOpenIds': None,\n",
|
||||
" 'teamName': None,\n",
|
||||
" 'gradeName': '2025级',\n",
|
||||
" 'className': '导师11班',\n",
|
||||
" 'sexName': None,\n",
|
||||
" 'battery': None,\n",
|
||||
" 'steps': None,\n",
|
||||
" 'rank': None,\n",
|
||||
" 'roleName': None,\n",
|
||||
" 'sleepStart': None,\n",
|
||||
" 'sleepEnd': None,\n",
|
||||
" 'type': None,\n",
|
||||
" 'setTime': None,\n",
|
||||
" 'status': None,\n",
|
||||
" 'userType': None,\n",
|
||||
" 'sumLocation': None,\n",
|
||||
" 'arkName': None}}"
|
||||
" 'data': {'id': 5454,\n",
|
||||
" 'pwd': '{bcrypt}$2a$10$I66PBUWdeoWYh/FcGfhB1O2T1a8NJOpFB8YVZtScmH3YO7tNzuSBm',\n",
|
||||
" 'locked': False,\n",
|
||||
" 'enabled': True,\n",
|
||||
" 'role': {'id': 168,\n",
|
||||
" 'roleName': '鸿兴演示中学家长',\n",
|
||||
" 'description': None,\n",
|
||||
" 'priority': 10,\n",
|
||||
" 'createTime': 1622713421000,\n",
|
||||
" 'updateTime': 1659193585000,\n",
|
||||
" 'teamId': 106,\n",
|
||||
" 'type': 1},\n",
|
||||
" 'teamId': 106,\n",
|
||||
" 'type': 3,\n",
|
||||
" 'authorities': [{'authority': '鸿兴演示中学家长'}],\n",
|
||||
" 'username': '2019240217HXYSZX',\n",
|
||||
" 'password': '{bcrypt}$2a$10$I66PBUWdeoWYh/FcGfhB1O2T1a8NJOpFB8YVZtScmH3YO7tNzuSBm',\n",
|
||||
" 'accountNonExpired': True,\n",
|
||||
" 'accountNonLocked': True,\n",
|
||||
" 'credentialsNonExpired': True}}"
|
||||
]
|
||||
},
|
||||
"execution_count": 3,
|
||||
"execution_count": 32,
|
||||
"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": [
|
||||
"get(f\"{ip}/uc/student/findBySerialNo\",params={\n",
|
||||
" \"teamId\":teamId,\n",
|
||||
" \"param\":\"3108683745\"\n",
|
||||
"},headers=header).json()"
|
||||
"get(f\"https://band.hxzhxy.cn/uc/account/current?access_token={access_token}\").json()"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "96366a8b",
|
||||
"id": "ffcb6b87",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"{'success': False, 'msg': '非法访问,没有认证', 'code': 10007, 'data': None}"
|
||||
]
|
||||
},
|
||||
"execution_count": 27,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
],
|
||||
"source": []
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "base",
|
||||
"display_name": "Python 3",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user