From 3718d297888e655e96f547a12d6c0abff14a4dac Mon Sep 17 00:00:00 2001 From: deloz Date: Fri, 14 Jun 2024 10:08:04 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E4=BC=81=E4=B8=9A=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E5=AE=A2=E6=9C=8D-=E8=8E=B7=E5=8F=96=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AF-=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E8=BF=94=E5=9B=9E=E5=AE=A2=E6=88=B748?= =?UTF-8?q?=E5=B0=8F=E6=97=B6=E5=86=85=E6=9C=80=E5=90=8E=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=E8=BF=9B=E5=85=A5=E4=BC=9A=E8=AF=9D=E7=9A=84=E4=B8=8A=E4=B8=8B?= =?UTF-8?q?=E6=96=87=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/work/accountService/customer/client.go | 7 +++++-- .../customer/response/responseCustomerBatchGet.go | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/work/accountService/customer/client.go b/src/work/accountService/customer/client.go index 83ded8e8..57bdcccc 100644 --- a/src/work/accountService/customer/client.go +++ b/src/work/accountService/customer/client.go @@ -2,7 +2,9 @@ package customer import ( "context" + "github.com/ArtisanCloud/PowerLibs/v3/object" + "github.com/ArtisanCloud/PowerWeChat/v3/src/kernel" "github.com/ArtisanCloud/PowerWeChat/v3/src/kernel/power" response2 "github.com/ArtisanCloud/PowerWeChat/v3/src/kernel/response" @@ -26,12 +28,13 @@ func NewClient(app kernel.ApplicationInterface) (*Client, error) { // 读取消息 // https://developer.work.weixin.qq.com/document/path/94670 -func (comp *Client) BatchGet(ctx context.Context, externalUserIDList []string) (*response.ResponseCustomerBatchGet, error) { +func (comp *Client) BatchGet(ctx context.Context, externalUserIDList []string, needEnterSessionContext bool) (*response.ResponseCustomerBatchGet, error) { result := &response.ResponseCustomerBatchGet{} options := &object.HashMap{ - "external_userid_list": externalUserIDList, + "external_userid_list": externalUserIDList, + "need_enter_session_context": needEnterSessionContext, } _, err := comp.BaseClient.HttpPostJson(ctx, "cgi-bin/kf/customer/batchget", options, nil, nil, result) diff --git a/src/work/accountService/customer/response/responseCustomerBatchGet.go b/src/work/accountService/customer/response/responseCustomerBatchGet.go index a51b31a4..b2b75ac9 100644 --- a/src/work/accountService/customer/response/responseCustomerBatchGet.go +++ b/src/work/accountService/customer/response/responseCustomerBatchGet.go @@ -9,5 +9,5 @@ type ResponseCustomerBatchGet struct { response.ResponseWork CustomerList []*power.HashMap `json:"customer_list"` - InvalidExternalUserID []*string `json:"invalid_external_userid"` + InvalidExternalUserID []string `json:"invalid_external_userid,omitempty"` } From 5856df8987bbcbf04cc9e152229a2468b4f36fa2 Mon Sep 17 00:00:00 2001 From: deloz Date: Mon, 17 Jun 2024 10:17:27 +0800 Subject: [PATCH 2/3] fix: field expect type --- src/work/accountService/customer/client.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/work/accountService/customer/client.go b/src/work/accountService/customer/client.go index 57bdcccc..7426a7da 100644 --- a/src/work/accountService/customer/client.go +++ b/src/work/accountService/customer/client.go @@ -32,9 +32,17 @@ func (comp *Client) BatchGet(ctx context.Context, externalUserIDList []string, n result := &response.ResponseCustomerBatchGet{} + var need uint32 + + if needEnterSessionContext { + need = 1 + } else { + need = 0 + } + options := &object.HashMap{ "external_userid_list": externalUserIDList, - "need_enter_session_context": needEnterSessionContext, + "need_enter_session_context": need, } _, err := comp.BaseClient.HttpPostJson(ctx, "cgi-bin/kf/customer/batchget", options, nil, nil, result) From 23164e3c5cf339eb8adee9b88cf492fe2533d70c Mon Sep 17 00:00:00 2001 From: Matrix-X Date: Tue, 10 Dec 2024 19:37:53 +0800 Subject: [PATCH 3/3] =?UTF-8?q?Revert=20"feat:=20=E4=BC=81=E4=B8=9A?= =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E5=AE=A2=E6=9C=8D-=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AF-?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E9=9C=80=E8=A6=81=E8=BF=94=E5=9B=9E=E5=AE=A2?= =?UTF-8?q?=E6=88=B748=E5=B0=8F=E6=97=B6=E5=86=85=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E8=BF=9B=E5=85=A5=E4=BC=9A=E8=AF=9D=E7=9A=84?= =?UTF-8?q?=E4=B8=8A=E4=B8=8B=E6=96=87=E4=BF=A1=E6=81=AF"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/work/accountService/customer/client.go | 15 ++------------- .../customer/response/responseCustomerBatchGet.go | 2 +- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/work/accountService/customer/client.go b/src/work/accountService/customer/client.go index 7426a7da..83ded8e8 100644 --- a/src/work/accountService/customer/client.go +++ b/src/work/accountService/customer/client.go @@ -2,9 +2,7 @@ package customer import ( "context" - "github.com/ArtisanCloud/PowerLibs/v3/object" - "github.com/ArtisanCloud/PowerWeChat/v3/src/kernel" "github.com/ArtisanCloud/PowerWeChat/v3/src/kernel/power" response2 "github.com/ArtisanCloud/PowerWeChat/v3/src/kernel/response" @@ -28,21 +26,12 @@ func NewClient(app kernel.ApplicationInterface) (*Client, error) { // 读取消息 // https://developer.work.weixin.qq.com/document/path/94670 -func (comp *Client) BatchGet(ctx context.Context, externalUserIDList []string, needEnterSessionContext bool) (*response.ResponseCustomerBatchGet, error) { +func (comp *Client) BatchGet(ctx context.Context, externalUserIDList []string) (*response.ResponseCustomerBatchGet, error) { result := &response.ResponseCustomerBatchGet{} - var need uint32 - - if needEnterSessionContext { - need = 1 - } else { - need = 0 - } - options := &object.HashMap{ - "external_userid_list": externalUserIDList, - "need_enter_session_context": need, + "external_userid_list": externalUserIDList, } _, err := comp.BaseClient.HttpPostJson(ctx, "cgi-bin/kf/customer/batchget", options, nil, nil, result) diff --git a/src/work/accountService/customer/response/responseCustomerBatchGet.go b/src/work/accountService/customer/response/responseCustomerBatchGet.go index b2b75ac9..a51b31a4 100644 --- a/src/work/accountService/customer/response/responseCustomerBatchGet.go +++ b/src/work/accountService/customer/response/responseCustomerBatchGet.go @@ -9,5 +9,5 @@ type ResponseCustomerBatchGet struct { response.ResponseWork CustomerList []*power.HashMap `json:"customer_list"` - InvalidExternalUserID []string `json:"invalid_external_userid,omitempty"` + InvalidExternalUserID []*string `json:"invalid_external_userid"` }