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

28 lines
742 B
Go
Raw Permalink Normal View History

2022-01-10 20:21:47 +08:00
package main
2022-01-12 01:44:10 +08:00
import (
"git.icechen.cn/monorepo/backend/app/zeus/api/lark/internal/user"
2022-01-14 01:28:43 +08:00
"git.icechen.cn/monorepo/backend/app/zeus/service/lark/pkg/admin"
2022-01-13 14:28:50 +08:00
"git.icechen.cn/monorepo/backend/pkg/api"
2022-01-12 01:44:10 +08:00
"github.com/gofiber/fiber/v2"
ctxLogger "github.com/luizsuper/ctxLoggers"
)
2022-01-10 20:21:47 +08:00
func main() {
2022-01-12 01:44:10 +08:00
router := fiber.New(fiber.Config{
AppName: "api-lark",
2022-01-13 15:27:19 +08:00
ErrorHandler: api.FiberMiddleWareErrHandler,
2022-01-12 01:44:10 +08:00
})
2022-01-13 15:27:19 +08:00
router.Use(api.FibberMiddleWareRespHandler)
2022-01-14 00:40:35 +08:00
router.Use(api.FibberUserCtxWithTraceHandler)
2022-01-12 01:44:10 +08:00
userRouter := router.Group("/user")
userRouter.Post("/login", user.LoginHandle)
2022-01-14 01:28:43 +08:00
userRouter.Post("/info", admin.MiddlewareLarkAdmin, user.InfoHandle)
2022-01-12 01:44:10 +08:00
err := router.Listen(":8080")
if err != nil {
ctxLogger.Error(nil, err.Error())
}
}