hertz101/app/user/handler.go
2025-01-20 16:01:57 +08:00

25 lines
738 B
Go

package main
import (
"context"
"github.com/suyiiyii/hertz101/app/user/biz/service"
user "github.com/suyiiyii/hertz101/rpc_gen/kitex_gen/user"
)
// UserServiceImpl implements the last service interface defined in the IDL.
type UserServiceImpl struct{}
// Register implements the UserServiceImpl interface.
func (s *UserServiceImpl) Register(ctx context.Context, req *user.RegisterReq) (resp *user.RegisterResp, err error) {
resp, err = service.NewRegisterService(ctx).Run(req)
return resp, err
}
// Login implements the UserServiceImpl interface.
func (s *UserServiceImpl) Login(ctx context.Context, req *user.LoginReq) (resp *user.LoginResp, err error) {
resp, err = service.NewLoginService(ctx).Run(req)
return resp, err
}