fix: PascalCase JSON fields + code:200 success + Unix timestamp ExpDate

This commit is contained in:
2026-07-28 17:09:39 +08:00
parent 7190d93edf
commit 9c3eba2327
4 changed files with 14 additions and 13 deletions
+4 -4
View File
@@ -16,9 +16,9 @@ func TestServerList(t *testing.T) {
resp := map[string]any{
"code": 0,
"data": map[string]any{
"records": []map[string]any{
"Records": []map[string]any{
{
"id": 12001,
"ID": 12001,
"name": "web-server",
"status": "running",
"ip": "1.2.3.4",
@@ -26,10 +26,10 @@ func TestServerList(t *testing.T) {
"memory": 4096,
"disk": 50,
"os": "Ubuntu 22.04",
"expire_date": "2026-08-15",
"ExpDate": 1756656000,
},
},
"totalRecords": 1,
"TotalRecords": 1,
},
}
json.NewEncoder(w).Encode(resp)