From 27fb10b9f64d4f69c7b36883a398173b2c4bc1cb Mon Sep 17 00:00:00 2001 From: wukesheng Date: Fri, 24 May 2024 17:12:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B9=B3=E5=8F=B0=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.go | 13 +++++++++++++ platform/meituan-union/api.go | 2 ++ 2 files changed, 15 insertions(+) diff --git a/index.go b/index.go index 4d83ab4..345fa5c 100644 --- a/index.go +++ b/index.go @@ -21,6 +21,19 @@ const ( PlatformDidiUnion = "didi_union" ) +// 平台名称 +var PlatformNameMap = map[string]string{ + PlatformElemeUnion: "饿了么联盟", + PlatformMeituanCsr: "美团分销联盟", + PlatformMeituanUnion: "美团联盟", + PlatformDidiUnion: "滴滴联盟", +} + +// GetPlatformName 获取平台名称 +func GetPlatformName(platform string) string { + return PlatformNameMap[platform] +} + // NewElemeUnionApi 饿了么联盟 func NewElemeUnionApi(log logx.Logger, conf elemeunion.AuthConfig) elemeunion.ElemeUnionApi { return elemeunion.NewApiClient(log, conf) diff --git a/platform/meituan-union/api.go b/platform/meituan-union/api.go index 614d997..c7b035b 100644 --- a/platform/meituan-union/api.go +++ b/platform/meituan-union/api.go @@ -104,6 +104,7 @@ func (a *meituanUnionApiImpl) GetOrderBySinge(params GetOrderBySingeRequest) (*G request.Sign = a.Sign(util.StructToMap(request)) queryArgs := util.StructToMap(request) req := &client.HttpRequest{Headers: a.client.Headers, QueryArgs: queryArgs} + // todo:: 返回完整的原始数据 response := new(GetOrderBySingeResponse) if err := a.client.HttpGet(GetOrderSinge, req, &client.HttpResponse{Result: response}); err != nil { return nil, err @@ -125,6 +126,7 @@ func (a *meituanUnionApiImpl) GetOrderByBatch(params GetOrderByBatchRequest) (*G queryArgs := util.StructToMap(request) fmt.Printf("queryArgs: %+v\n", queryArgs) req := &client.HttpRequest{Headers: a.client.Headers, QueryArgs: queryArgs} + // todo:: 返回完整的原始数据 response := new(GetOrderByBatchResponse) if err := a.client.HttpGet(GetOrderBatch, req, &client.HttpResponse{Result: response}); err != nil { a.log.Errorf("GetOrderByBatch error: %v", err)