This commit is contained in:
laodaming 2023-11-07 10:46:55 +08:00
parent 07fcd4b7b7
commit 25b774c905

View File

@ -25,6 +25,9 @@ func NewWebhookLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WebhookLo
}
}
type EncryptWebhookMsg struct {
Encrypt string `json:"encrypt"` //加密的消息
}
type WebhookMsg struct {
Type string `json:"type"`
Challenge string `json:"challenge"`
@ -48,7 +51,8 @@ func (l *WebhookLogic) Webhook(w http.ResponseWriter, r *http.Request) {
logx.Error("读取请求body失败", err)
return
}
logx.Info("收到消息:", string(bodyBytes))
logx.Info("收到头消息:", r.Header)
logx.Info("收到body消息:", string(bodyBytes))
defer r.Body.Close()
//如果只是验证http连接的消息
var webhookMsg WebhookMsg