Skip to content

Commit 0127d53

Browse files
authored
Merge pull request #11 from ysicing/master
* imp clean record
2 parents 0256562 + e2171b2 commit 0127d53

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

client.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"encoding/json"
66
"io"
77
"net/http"
8-
"strconv"
98
"strings"
109
"time"
1110

@@ -123,7 +122,7 @@ func (p *Provider) deleteRecord(ctx context.Context, id uint64, zone string) err
123122

124123
requestData := DeleteRecordRequest{
125124
Domain: domain,
126-
RecordId: strconv.FormatUint(id, 10),
125+
RecordId: id,
127126
}
128127

129128
payload, err := json.Marshal(requestData)
@@ -145,7 +144,6 @@ func (p *Provider) findRecord(ctx context.Context, zone string, record libdns.Re
145144
Subdomain: r.Name,
146145
Limit: 3000,
147146
}
148-
149147
payload, err := json.Marshal(requestData)
150148
if err != nil {
151149
return 0, err
@@ -160,7 +158,6 @@ func (p *Provider) findRecord(ctx context.Context, zone string, record libdns.Re
160158
if err = json.Unmarshal(resp, &response); err != nil {
161159
return 0, err
162160
}
163-
164161
var recordId uint64
165162
for _, item := range response.Response.RecordList {
166163
if item.Name == r.Name && item.Type == r.Type {

types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type FindRecordRequest struct {
3535

3636
type DeleteRecordRequest struct {
3737
Domain string `json:"Domain"`
38-
RecordId string `json:"RecordId"`
38+
RecordId uint64 `json:"RecordId"`
3939
}
4040

4141
type Response struct {

0 commit comments

Comments
 (0)