Browse Source

docs: 更新API测试文件,添加WebSocket和认证相关端点

refactor/repository-structure
hyh 8 months ago
parent
commit
0363255029
  1. 32
      src/CellularManagement.WebAPI/CellularManagement.WebAPI.http

32
src/CellularManagement.WebAPI/CellularManagement.WebAPI.http

@ -1,6 +1,36 @@
@CellularManagement.WebAPI_HostAddress = http://localhost:5202
@WebSocket_HostAddress = ws://localhost:5202
### 获取天气预测
GET {{CellularManagement.WebAPI_HostAddress}}/weatherforecast/
Accept: application/json
###
### 用户认证
# @name login
POST {{CellularManagement.WebAPI_HostAddress}}/api/auth/login
Content-Type: application/json
{
"username": "admin",
"password": "admin123"
}
### 获取用户信息
GET {{CellularManagement.WebAPI_HostAddress}}/api/users/me
Authorization: Bearer {{login.response.body.token}}
### WebSocket连接测试
# 使用WebSocket客户端工具连接
# 连接地址: {{WebSocket_HostAddress}}/ws
### 发送WebSocket消息
# 使用WebSocket客户端工具发送消息
# 消息格式: {"type": "message", "content": "Hello, WebSocket!"}
### 获取系统状态
GET {{CellularManagement.WebAPI_HostAddress}}/api/system/status
Authorization: Bearer {{login.response.body.token}}
### 获取WebSocket连接统计
GET {{CellularManagement.WebAPI_HostAddress}}/api/websocket/stats
Authorization: Bearer {{login.response.body.token}}

Loading…
Cancel
Save