This commit is contained in:
laodaming 2023-11-06 17:28:34 +08:00
parent 64ec884b88
commit c3b75656a4

View File

@ -16,7 +16,9 @@ import (
func WebhookHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { func WebhookHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) { return func(w http.ResponseWriter, r *http.Request) {
b, _ := io.ReadAll(r.Body)
defer r.Body.Close()
log.Println("收到body信息:", string(b))
var req types.WebhookReq var req types.WebhookReq
userinfo, err := basic.RequestParse(w, r, svcCtx, &req) userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
if err != nil { if err != nil {
@ -31,10 +33,7 @@ func WebhookHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
w.Write(b) w.Write(b)
return return
} }
b, _ := io.ReadAll(r.Body)
defer r.Body.Close()
log.Println("收到头消息:", r.Header) log.Println("收到头消息:", r.Header)
log.Println("收到body信息:", string(b))
// 创建一个业务逻辑层实例 // 创建一个业务逻辑层实例
l := logic.NewWebhookLogic(r.Context(), svcCtx) l := logic.NewWebhookLogic(r.Context(), svcCtx)