diff --git a/entity.go b/entity.go index 6250e36..20acd2d 100644 --- a/entity.go +++ b/entity.go @@ -24,10 +24,10 @@ type ShortUrlBatchCreate struct { type ShortUrlBatchCreateResult struct { Id int32 `json:"id"` // 名称 - BatchName string `json:"batch_name"` + BatchName string `json:"batchName"` // 批次号 - BatchNo int64 `json:"batch_no"` - UrlMap map[string]string `json:"url_map,omitempty"` + BatchNo string `json:"batchNo"` + UrlMap map[string]string `json:"urlMap,omitempty"` } type ShortUrlCreateReq struct { diff --git a/short_url.go b/short_url.go index 6127d7f..7d71a5d 100644 --- a/short_url.go +++ b/short_url.go @@ -57,12 +57,12 @@ func (s *ShortUrl) BatchCreate(in *ShortUrlBatchCreate) (*ShortUrlBatchCreateRes if err != nil { return nil, fmt.Errorf("请求失败,err: %v", err) } - var resData ShortUrlBatchCreateResult - err = CheckHttpRes(&resp, &resData) + var resData = &ShortUrlBatchCreateResult{} + err = CheckHttpRes(&resp, resData) if err != nil { return nil, err } - return &resData, nil + return resData, nil } func (s *ShortUrl) BatchQuery(in *BatchQueryReq) (*QueryBatchWithUrlResp, error) {