22 lines
408 B
Go
22 lines
408 B
Go
package server
|
|
|
|
import (
|
|
"common/log"
|
|
"common/proto/ss/grpc_pb"
|
|
"context"
|
|
"user/internal/dao/repository"
|
|
)
|
|
|
|
func (s *Server) Login(ctx context.Context, req *grpc_pb.LoginReq) (*grpc_pb.LoginResp, error) {
|
|
log.Infof("Login req: %+v", req)
|
|
|
|
user, err := repository.NewUserDao(ctx).FindBySn(857527344353)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &grpc_pb.LoginResp{
|
|
UID: int32(user.Sn),
|
|
}, nil
|
|
}
|