From 8409760713eaa5178c310dd44f6eb50387f1be55 Mon Sep 17 00:00:00 2001 From: wwek Date: Wed, 4 Nov 2026 22:22:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(kf):=20=E8=8E=B7=E5=8F=96=E5=AE=A2?= =?UTF-8?q?=E6=88=B7=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AF=E6=94=AF=E6=8C=81?= =?UTF-8?q?=20need=5Fenter=5Fsession=5Fcontext=20=E5=8F=8A=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E4=BC=9A=E8=AF=9D=E4=B8=8A=E4=B8=8B=E6=96=87=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=20(#894)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- work/kf/customer.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/work/kf/customer.go b/work/kf/customer.go index 1ded143..8de5860 100644 --- a/work/kf/customer.go +++ b/work/kf/customer.go @@ -14,6 +14,24 @@ const ( // CustomerBatchGetOptions 客户基本信息获取请求参数 type CustomerBatchGetOptions struct { ExternalUserIDList []string `json:"external_userid_list"` // external_userid列表 + // NeedEnterSessionContext 是否需要返回客户48小时内最后一次进入会话的上下文信息 + // 0-不返回 1-返回。默认不返回 + NeedEnterSessionContext int `json:"need_enter_session_context"` +} + +// CustomerWechatChannelsSchema 进入会话的视频号信息,从视频号进入会话才有值 +type CustomerWechatChannelsSchema struct { + Nickname string `json:"nickname"` // 视频号名称,视频号场景值为1、2、3时返回此项 + ShopNickname string `json:"shop_nickname"` // 视频号小店名称,视频号场景值为4、5时返回此项 + Scene uint32 `json:"scene"` // 视频号场景值。1:视频号主页,2:视频号直播间商品列表页,3:视频号商品橱窗页,4:视频号小店商品详情页,5:视频号小店订单页 +} + +// CustomerEnterSessionContextSchema 48小时内最后一次进入会话的上下文信息 +// 请求的need_enter_session_context参数设置为1才返回 +type CustomerEnterSessionContextSchema struct { + Scene string `json:"scene"` // 进入会话的场景值,获取客服账号链接开发者自定义的场景值 + SceneParam string `json:"scene_param"` // 进入会话的自定义参数,获取客服账号链接返回的url,开发者按规范拼接的scene_param参数 + WechatChannels CustomerWechatChannelsSchema `json:"wechat_channels"` // 进入会话的视频号信息,从视频号进入会话才有值 } // CustomerSchema 微信客户基本资料 @@ -23,6 +41,9 @@ type CustomerSchema struct { Avatar string `json:"avatar"` // 微信头像。第三方不可获取 Gender int `json:"gender"` // 性别 UnionID string `json:"unionid"` // unionid,需要绑定微信开发者帐号才能获取到,查看绑定方法: https://open.work.weixin.qq.com/kf/doc/92512/93143/94769#%E5%A6%82%E4%BD%95%E8%8E%B7%E5%8F%96%E5%BE%AE%E4%BF%A1%E5%AE%A2%E6%88%B7%E7%9A%84unionid + // EnterSessionContext 48小时内最后一次进入会话的上下文信息 + // 请求的need_enter_session_context参数设置为1才返回 + EnterSessionContext CustomerEnterSessionContextSchema `json:"enter_session_context"` } // CustomerBatchGetSchema 获取客户基本信息响应内容