diff --git a/src/officialAccount/templateMessage/response/responseTemplateSetIndustry.go b/src/officialAccount/templateMessage/response/responseTemplateSetIndustry.go index 3398787e..e5e20b54 100644 --- a/src/officialAccount/templateMessage/response/responseTemplateSetIndustry.go +++ b/src/officialAccount/templateMessage/response/responseTemplateSetIndustry.go @@ -38,5 +38,5 @@ type ResponseTemplateGetPrivate struct { type ResponseTemplateSend struct { response.ResponseOfficialAccount - MsgID int `json:"msgid"` + MsgID int64 `json:"msgid"` } diff --git a/src/work/accountService/client.go b/src/work/accountService/client.go index 881e520f..bd3cd5dd 100644 --- a/src/work/accountService/client.go +++ b/src/work/accountService/client.go @@ -82,9 +82,12 @@ func (comp *Client) AddContactWay(ctx context.Context, openKFID string, scene st result := &response.ResponseAccountServiceAddContactWay{} - options := &object.HashMap{ + var options *object.HashMap + options = &object.HashMap{ "open_kfid": openKFID, - "scene": scene, + } + if scene != "" { + (*options)["scene"] = scene } _, err := comp.BaseClient.HttpPostJson(ctx, "cgi-bin/kf/add_contact_way", options, nil, nil, result) diff --git a/src/work/accountService/customer/client.go b/src/work/accountService/customer/client.go index 83ded8e8..c062ab04 100644 --- a/src/work/accountService/customer/client.go +++ b/src/work/accountService/customer/client.go @@ -26,12 +26,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 int8) (*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"` }