This commit is contained in:
unknown
2026-02-04 20:27:13 +08:00
commit 3b042d1dad
9410 changed files with 1488147 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
// Copyright 2023 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package dnsla
type AllLineListResponseChild struct {
Id string `json:"id"`
Name string `json:"name"`
Code string `json:"code"`
Children []AllLineListResponseChild `json:"children"`
}
type AllLineListResponse struct {
BaseResponse
Data []AllLineListResponseChild `json:"data"`
}

View File

@@ -0,0 +1,21 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package dnsla
import (
"errors"
"github.com/iwind/TeaGo/types"
)
type BaseResponse struct {
Code int `json:"code"`
Msg string `json:"msg"`
}
func (this *BaseResponse) Success() bool {
return this.Code == 200
}
func (this *BaseResponse) Error() error {
return errors.New("code:" + types.String(this.Code) + ", message:" + this.Msg)
}

View File

@@ -0,0 +1,11 @@
// Copyright 2023 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
package dnsla
type DomainResponse struct {
BaseResponse
Data struct {
Id string `json:"id"`
} `json:"data"`
}

View File

@@ -0,0 +1,15 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package dnsla
type DomainListResponse struct {
BaseResponse
Data struct {
Total int `json:"total"`
Results []struct {
Id string `json:"id"`
Domain string `json:"domain"`
} `json:"results"`
} `json:"data"`
}

View File

@@ -0,0 +1,66 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package dnsla
import (
"encoding/json"
"testing"
)
func TestDomainListResponse(t *testing.T) {
var bodyJSON = []byte(`{
"status": {
"code": 300,
"name": "操作成功",
"message": "",
"request_time": "2022-08-07 07:43:34"
},
"total": {
"all_total": 3,
"data_total": 3,
"skip_number": 0
},
"datas": [
{
"domainid": 6772732,
"userid": 459662,
"domainname": "hello3.com",
"grade": "免费套餐",
"domain_status": "正常",
"domain_active": "yes",
"groupid": 0,
"nsstate": "未知",
"createtime": "2022-08-07 07:42:27"
},
{
"domainid": 6772731,
"userid": 459662,
"domainname": "hello2.com",
"grade": "免费套餐",
"domain_status": "正常",
"domain_active": "yes",
"groupid": 0,
"nsstate": "未知",
"createtime": "2022-08-07 07:42:19"
},
{
"domainid": 6772358,
"userid": 459662,
"domainname": "hello1234.com",
"grade": "免费套餐",
"domain_status": "正常",
"domain_active": "yes",
"groupid": 0,
"nsstate": "错误",
"createtime": "2022-08-07 11:42:05"
}
]
}`)
var resp = &DomainListResponse{}
err := json.Unmarshal(bodyJSON, resp)
if err != nil {
t.Fatal(err)
}
t.Logf("%+v", resp)
t.Log(resp.Success(), resp.Error())
}

View File

@@ -0,0 +1,11 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package dnsla
type RecordCreateResponse struct {
BaseResponse
Data struct {
Id string `json:"id"`
} `json:"data"`
}

View File

@@ -0,0 +1,7 @@
// Copyright 2023 GoEdge CDN goedge.cdn@gmail.com. All rights reserved. Official site: https://goedge.cn .
package dnsla
type RecordDeleteResponse struct {
BaseResponse
}

View File

@@ -0,0 +1,22 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package dnsla
type RecordListResponse struct {
BaseResponse
Data struct {
Total int `json:"total"`
Results []struct {
Id string `json:"id"`
Host string `json:"host"`
Data string `json:"data"`
TTL int `json:"ttl"`
Type int `json:"type"`
LineId string `json:"lineId"`
LineCode string `json:"lineCode"`
LineName string `json:"lineName"`
Weight int `json:"weight"`
} `json:"results"`
} `json:"data"`
}

View File

@@ -0,0 +1,7 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package dnsla
type RecordUpdateResponse struct {
BaseResponse
}