hertz101/app/user/handler.go
2025-01-17 17:09:32 +08:00

25 lines
739 B
Go

package main
import (
"context"
user "github.com/suyiiyii/hertz101/rpc_gen/kitex_gen/user"
"github.com/suyiiyii/hertz101/app/user/biz/service"
)
// 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.RegisterResp) (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
}