feat: 添加多个功能模块和工具脚本
- 新增websocket客户端和服务端实现 - 添加图片压缩工具和快速压缩脚本 - 实现学生信息处理相关API - 添加MQTT客户端和消息处理功能 - 更新.gitignore忽略更多文件类型 - 添加数据库操作工具和示例 - 实现多个测试脚本和工具类
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
from requests import get,post
|
||||
import pandas as pd
|
||||
import time
|
||||
import os
|
||||
|
||||
teamId = 106
|
||||
ip = "http://10.143.25.3:8090"
|
||||
param = {
|
||||
"username": "tangchao",
|
||||
"password": "123456a",
|
||||
"client_id": "client",
|
||||
"grant_type": "password",
|
||||
"client_secret": "123456",
|
||||
}
|
||||
data = get(url=f"{ip}/oauth/token",params=param).json()
|
||||
token = data["access_token"]
|
||||
header = {
|
||||
"content-type": "application/json",
|
||||
"authorization": f"Bearer {token}",
|
||||
}
|
||||
for root, dirs, files in os.walk("./students/"):
|
||||
for file in files:
|
||||
formFile = open(os.path.join(root, file), "rb")
|
||||
mu_files = {
|
||||
"file": (file, formFile, "image/jpeg"),
|
||||
}
|
||||
response = post(url=f"{ip}/school/stuface/upload", headers=, files=mu_files)
|
||||
print(file)
|
||||
print(response.json())
|
||||
formFile.close()
|
||||
break
|
||||
break
|
||||
Reference in New Issue
Block a user