package user import ( "git.icechen.cn/monorepo/backend/pkg/proto/zeus/lark" "git.icechen.cn/monorepo/backend/pkg/rpc" "git.icechen.cn/monorepo/backend/pkg/validator" "github.com/gofiber/fiber/v2" ctxLogger "github.com/luizsuper/ctxLoggers" "go.uber.org/zap" ) func LoginHandle(c *fiber.Ctx) error { var p = struct { Code string `json:"code" validate:"required"` Email string `json:"email" label:"邮箱" validate:"email"` }{} err := validator.Bind(c, &p) if err != nil { return err } response, err := lark.NewUserClient(rpc.GetServiceConn("lark")).Login(c.Context(), &lark.LoginRequest{ Code: p.Code, }) if err != nil { return err } ctxLogger.FInfo(c, "response", zap.Any("resp", response)) return c.JSON(response) }