35 lines
927 B
Go
35 lines
927 B
Go
package wxrouter
|
|
|
|
import (
|
|
"xiawan/wx/clientsdk"
|
|
"xiawan/wx/protobuf/wechat"
|
|
"xiawan/wx/srv/wxcore"
|
|
"xiawan/wx/srv/wxface"
|
|
)
|
|
|
|
// WXAddContactLabelRouter 心跳包响应路由
|
|
type WXAddContactLabelRouter struct {
|
|
wxcore.WXBaseRouter
|
|
}
|
|
|
|
// Handle 处理conn业务的方法
|
|
func (hbr *WXAddContactLabelRouter) Handle(wxResp wxface.IWXResponse) error {
|
|
currentWXConn := wxResp.GetWXConncet()
|
|
currentWXAccount := currentWXConn.GetWXAccount()
|
|
currentUserInfo := currentWXAccount.GetUserInfo()
|
|
currentReqInvoker := currentWXConn.GetWXReqInvoker()
|
|
|
|
// 解析退出登陆响应包
|
|
var addLabelResp wechat.AddContactLabelResponse
|
|
err := clientsdk.ParseResponseData(currentUserInfo, wxResp.GetPackHeader(), &addLabelResp)
|
|
if err != nil {
|
|
// 请求出问题了,应该关闭链接
|
|
currentWXConn.Stop()
|
|
return err
|
|
}
|
|
|
|
// 跟新标签列表
|
|
_, _ = currentReqInvoker.SendGetContactLabelListRequest(false)
|
|
return nil
|
|
}
|