diff --git a/server/feishu-sync/internal/handler/webhookhandler.go b/server/feishu-sync/internal/handler/webhookhandler.go index cfddae9d..8870982d 100644 --- a/server/feishu-sync/internal/handler/webhookhandler.go +++ b/server/feishu-sync/internal/handler/webhookhandler.go @@ -2,6 +2,8 @@ package handler import ( "encoding/json" + "io" + "log" "net/http" "reflect" @@ -29,6 +31,9 @@ func WebhookHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { w.Write(b) return } + b, _ := io.ReadAll(r.Body) + defer r.Body.Close() + log.Println("收到消息:", string(b)) // 创建一个业务逻辑层实例 l := logic.NewWebhookLogic(r.Context(), svcCtx) diff --git a/server/feishu-sync/internal/logic/webhooklogic.go b/server/feishu-sync/internal/logic/webhooklogic.go index 3e85dedf..df526a6c 100644 --- a/server/feishu-sync/internal/logic/webhooklogic.go +++ b/server/feishu-sync/internal/logic/webhooklogic.go @@ -31,9 +31,6 @@ func NewWebhookLogic(ctx context.Context, svcCtx *svc.ServiceContext) *WebhookLo // } func (l *WebhookLogic) Webhook(req *types.WebhookReq, userinfo *auth.UserInfo) (resp *basic.Response) { - // 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data) - // userinfo 传入值时, 一定不为null - return resp.SetStatus(basic.CodeOK) }