This commit is contained in:
laodaming
2023-11-09 14:30:06 +08:00
parent 6b44eb780d
commit 892509b5db
10 changed files with 508 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
// Code generated by goctl. DO NOT EDIT.
package handler
import (
"net/http"
"fusenapi/server/feishu-sync/internal/svc"
"github.com/zeromicro/go-zero/rest"
)
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodPost,
Path: "/api/feishu/webhook",
Handler: WebhookHandler(serverCtx),
},
},
)
}

View File

@@ -0,0 +1,15 @@
package handler
import (
"fusenapi/server/feishu-sync/internal/logic"
"fusenapi/server/feishu-sync/internal/svc"
"net/http"
)
func WebhookHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
// 创建一个业务逻辑层实例
l := logic.NewWebhookLogic(r.Context(), svcCtx)
l.Webhook(w, r)
}
}