fix: add getList with records wrapper + correct options format from browser capture

This commit is contained in:
2026-07-28 17:03:59 +08:00
parent 284a503541
commit 7190d93edf
7 changed files with 56 additions and 15 deletions
+14 -11
View File
@@ -15,18 +15,21 @@ func TestServerList(t *testing.T) {
}
resp := map[string]any{
"code": 0,
"data": []map[string]any{
{
"id": 12001,
"name": "web-server",
"status": "running",
"ip": "1.2.3.4",
"vcpu": 2,
"memory": 4096,
"disk": 50,
"os": "Ubuntu 22.04",
"expire_date": "2026-08-15",
"data": map[string]any{
"records": []map[string]any{
{
"id": 12001,
"name": "web-server",
"status": "running",
"ip": "1.2.3.4",
"vcpu": 2,
"memory": 4096,
"disk": 50,
"os": "Ubuntu 22.04",
"expire_date": "2026-08-15",
},
},
"totalRecords": 1,
},
}
json.NewEncoder(w).Encode(resp)