user.go 514 Bytes
Newer Older
kzkzzzz's avatar
kzkzzzz committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
package handler

import (
	"context"
	"hilo/api/service/user"
	"hilo/app/service/user/internal/service"
)

type UserService struct {
	user.UnimplementedUserServer
	svc *service.UserService
}

func (s *UserService) Login(ctx context.Context, req *user.LoginReq) (*user.LoginRep, error) {
	res, err := s.svc.Login(ctx, req)
	if err != nil {
		return nil, err
	}
	return res, nil
}

var _ user.UserServer = &UserService{}

func NewUserHandler(svc *service.UserService) *UserService {
	return &UserService{svc: svc}
}