feat(domain): add GetDomainDNSRecordList endpoint

This commit is contained in:
2026-08-13 00:24:20 +08:00
parent 4029244702
commit 5cf02155dc
2 changed files with 27 additions and 1 deletions
+26
View File
@@ -70,3 +70,29 @@ func (s *DomainService) SyncDomainDNSSEC(id int) (*common.BasicOperationResponse
return &resp, err
}
// 获取域名DNS解析记录列表
//
// domainID: 域名ID
func (s *DomainService) GetDomainDNSRecordList(domainID int) (*GetDomainDNSRecordListResponse, error) {
path := fmt.Sprintf("/product/domain/%d/dns", domainID)
var resp GetDomainDNSRecordListResponse
err := s.client.Do(constant.HTTPMethod_GET, path, nil, nil, &resp)
return &resp, err
}
// DNS 记录列表响应
type GetDomainDNSRecordListResponse struct {
Code int `json:"code"`
Data []DomainDNSRecord `json:"data"`
}
// 域名DNS解析记录
type DomainDNSRecord struct {
ID int `json:"id"`
RecordType string `json:"record_type"`
Host string `json:"host"`
Value string `json:"value"`
TTL int `json:"ttl"`
}
+1 -1
View File
@@ -41,4 +41,4 @@ func (s *DomainService) GetDomainList(req *GetDomainListRequest) (*GetDomainList
}
err = s.client.Do(constant.HTTPMethod_GET, path, querys, nil, &resp)
return &resp, err
}
}