backend/app/zeus/api/lark/internal/user/user.go

32 lines
657 B
Go
Raw Normal View History

2022-01-12 01:44:10 +08:00
package user
import (
"git.icechen.cn/monorepo/backend/pkg/proto/zeus/lark"
"git.icechen.cn/monorepo/backend/pkg/rpc"
"github.com/gofiber/fiber/v2"
ctxLogger "github.com/luizsuper/ctxLoggers"
"go.uber.org/zap"
)
var ErrorUser = fiber.NewError(0, "错误")
func LoginHandle(c *fiber.Ctx) error {
var p = struct {
Code string `json:"code"`
}{}
err := c.BodyParser(&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)
}