backend/app/zeus/api/lark/main.go

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())
}
}