backend/app/zeus/api/lark/main.go
icechen e932171ffa
All checks were successful
continuous-integration/drone/push Build is passing
feat: 封装中间件
2022-01-14 01:28:43 +08:00

28 lines
742 B
Go
Executable File

package main
import (
"git.icechen.cn/monorepo/backend/app/zeus/api/lark/internal/user"
"git.icechen.cn/monorepo/backend/app/zeus/service/lark/pkg/admin"
"git.icechen.cn/monorepo/backend/pkg/api"
"github.com/gofiber/fiber/v2"
ctxLogger "github.com/luizsuper/ctxLoggers"
)
func main() {
router := fiber.New(fiber.Config{
AppName: "api-lark",
ErrorHandler: api.FiberMiddleWareErrHandler,
})
router.Use(api.FibberMiddleWareRespHandler)
router.Use(api.FibberUserCtxWithTraceHandler)
userRouter := router.Group("/user")
userRouter.Post("/login", user.LoginHandle)
userRouter.Post("/info", admin.MiddlewareLarkAdmin, user.InfoHandle)
err := router.Listen(":8080")
if err != nil {
ctxLogger.Error(nil, err.Error())
}
}