fix
This commit is contained in:
22
server/feishu-sync/internal/handler/routes.go
Normal file
22
server/feishu-sync/internal/handler/routes.go
Normal 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),
|
||||
},
|
||||
},
|
||||
)
|
||||
}
|
||||
15
server/feishu-sync/internal/handler/webhookhandler.go
Normal file
15
server/feishu-sync/internal/handler/webhookhandler.go
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user