主要修改: 1. 在LinkController中新增选区和轮询上号接口,支持用户选择游戏区域和检查上号状态。 2. 在LinkStatusService中实现选区操作逻辑,包含空闲设备检查和状态更新。 3. 更新ScriptClient,增加获取设备二维码和检查设备状态的功能。 4. 修改SecurityConfig,允许选区和轮询上号接口公开访问。 5. 更新application.yml,添加应用基础URL配置。 技术细节: - 新增SelectRegionResponse和PollLoginResponse DTO以支持新功能的返回格式。 - 通过脚本端接口实现选区和上号状态的检查与更新。
49 lines
745 B
HTTP
49 lines
745 B
HTTP
### 测试选区接口
|
|
|
|
# 测试选区API - 选择Q区
|
|
POST http://localhost:8080/api/link/select-region
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"code": "66L8NM3L",
|
|
"region": "Q"
|
|
}
|
|
|
|
###
|
|
|
|
# 测试选区API - 选择V区
|
|
POST http://localhost:8080/api/link/select-region
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"code": "66L8NM3L",
|
|
"region": "V"
|
|
}
|
|
|
|
###
|
|
|
|
# 测试链接状态API
|
|
GET http://localhost:8080/api/link/status?code=66L8NM3L
|
|
|
|
###
|
|
|
|
# 测试参数验证 - 无效region
|
|
POST http://localhost:8080/api/link/select-region
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"code": "66L8NM3L",
|
|
"region": "X"
|
|
}
|
|
|
|
###
|
|
|
|
# 测试参数验证 - 空code
|
|
POST http://localhost:8080/api/link/select-region
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"code": "",
|
|
"region": "Q"
|
|
}
|