From 8ed264d90f0d13b72a0cb3cd1be3c11c2ff6f9f0 Mon Sep 17 00:00:00 2001 From: wukesheng Date: Sun, 23 Jun 2024 17:45:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=81=9A=E6=8E=A8=E5=AE=A2api=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platform/jutuike/api.go | 6 ++++-- platform/jutuike/types.go | 12 ++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/platform/jutuike/api.go b/platform/jutuike/api.go index d3529e9..d6d8623 100644 --- a/platform/jutuike/api.go +++ b/platform/jutuike/api.go @@ -51,7 +51,8 @@ func (a *jutuikeApiImpl) GenerateLink(ctx context.Context, req GenerateLinkReque Errorf("[jutuikeApiImpl][GenerateLink] response result error: %s", response.Msg) return nil, errors.New(response.Msg) } - return response.Data, nil + result := response.Data.(GenerateLinkData) + return &result, nil } // QueryOrderList 查询订单列表 @@ -79,5 +80,6 @@ func (a *jutuikeApiImpl) QueryOrderList(ctx context.Context, req QueryOrderListR Errorf("[jutuikeApiImpl][QueryOrderList] response result error: %s", response.Msg) return nil, errors.New(response.Msg) } - return response.Data, nil + result := response.Data.(QueryOrderListData) + return &result, nil } diff --git a/platform/jutuike/types.go b/platform/jutuike/types.go index a6bd294..3d0e309 100644 --- a/platform/jutuike/types.go +++ b/platform/jutuike/types.go @@ -8,9 +8,9 @@ type GenerateLinkRequest struct { // GenerateLinkResponse 生成推广链接响应 type GenerateLinkResponse struct { - Code int32 `json:"code"` // 错误码:0-错误,1-成功 - Msg string `json:"msg"` // 错误消息 - Data *GenerateLinkData `json:"data"` // 数据结构 + Code int32 `json:"code"` // 错误码:0-错误,1-成功 + Msg string `json:"msg"` // 错误消息 + Data any `json:"data"` // 数据结构,注意如果错误码为0,则data返回的是[], 如果为1,返回的是GenerateLinkData } type GenerateLinkData struct { @@ -43,9 +43,9 @@ type QueryOrderListRequest struct { // 查询订单列表响应 type QueryOrderListResponse struct { - Code int32 `json:"code"` // 错误码:0-错误,1-成功 - Msg string `json:"msg"` // 错误消息 - Data *QueryOrderListData `json:"data"` // 数据结构 + Code int32 `json:"code"` // 错误码:0-错误,1-成功 + Msg string `json:"msg"` // 错误消息 + Data any `json:"data"` // 数据结构,注意如果错误码为0,则data返回的是[], 如果为1,QueryOrderListData } type QueryOrderListData struct {