86 lines
2.7 KiB
Go
86 lines
2.7 KiB
Go
// Code generated by goctl. DO NOT EDIT.
|
|
// goctl 1.9.2
|
|
// Source: users.proto
|
|
|
|
package server
|
|
|
|
import (
|
|
"context"
|
|
|
|
"juwan-backend/app/users/rpc/internal/logic"
|
|
"juwan-backend/app/users/rpc/internal/svc"
|
|
"juwan-backend/app/users/rpc/pb"
|
|
)
|
|
|
|
type UsercenterServer struct {
|
|
svcCtx *svc.ServiceContext
|
|
pb.UnimplementedUsercenterServer
|
|
}
|
|
|
|
func NewUsercenterServer(svcCtx *svc.ServiceContext) *UsercenterServer {
|
|
return &UsercenterServer{
|
|
svcCtx: svcCtx,
|
|
}
|
|
}
|
|
|
|
// -----------------------users-----------------------
|
|
func (s *UsercenterServer) AddUsers(ctx context.Context, in *pb.AddUsersReq) (*pb.AddUsersResp, error) {
|
|
l := logic.NewAddUsersLogic(ctx, s.svcCtx)
|
|
return l.AddUsers(in)
|
|
}
|
|
|
|
func (s *UsercenterServer) UpdateUsers(ctx context.Context, in *pb.UpdateUsersReq) (*pb.UpdateUsersResp, error) {
|
|
l := logic.NewUpdateUsersLogic(ctx, s.svcCtx)
|
|
return l.UpdateUsers(in)
|
|
}
|
|
|
|
func (s *UsercenterServer) DelUsers(ctx context.Context, in *pb.DelUsersReq) (*pb.DelUsersResp, error) {
|
|
l := logic.NewDelUsersLogic(ctx, s.svcCtx)
|
|
return l.DelUsers(in)
|
|
}
|
|
|
|
func (s *UsercenterServer) GetUsersById(ctx context.Context, in *pb.GetUsersByIdReq) (*pb.GetUsersByIdResp, error) {
|
|
l := logic.NewGetUsersByIdLogic(ctx, s.svcCtx)
|
|
return l.GetUsersById(in)
|
|
}
|
|
|
|
func (s *UsercenterServer) GetUserByUsername(ctx context.Context, in *pb.GetUserByUsernameReq) (*pb.GetUserByUsernameResp, error) {
|
|
l := logic.NewGetUserByUsernameLogic(ctx, s.svcCtx)
|
|
return l.GetUserByUsername(in)
|
|
}
|
|
|
|
func (s *UsercenterServer) SearchUsers(ctx context.Context, in *pb.SearchUsersReq) (*pb.SearchUsersResp, error) {
|
|
l := logic.NewSearchUsersLogic(ctx, s.svcCtx)
|
|
return l.SearchUsers(in)
|
|
}
|
|
|
|
func (s *UsercenterServer) Login(ctx context.Context, in *pb.LoginReq) (*pb.LoginResp, error) {
|
|
l := logic.NewLoginLogic(ctx, s.svcCtx)
|
|
return l.Login(in)
|
|
}
|
|
|
|
func (s *UsercenterServer) Register(ctx context.Context, in *pb.RegisterReq) (*pb.RegisterResp, error) {
|
|
l := logic.NewRegisterLogic(ctx, s.svcCtx)
|
|
return l.Register(in)
|
|
}
|
|
|
|
func (s *UsercenterServer) ValidateToken(ctx context.Context, in *pb.ValidateTokenReq) (*pb.ValidateTokenResp, error) {
|
|
l := logic.NewValidateTokenLogic(ctx, s.svcCtx)
|
|
return l.ValidateToken(in)
|
|
}
|
|
|
|
func (s *UsercenterServer) CheckPermission(ctx context.Context, in *pb.CheckPermissionReq) (*pb.CheckPermissionResp, error) {
|
|
l := logic.NewCheckPermissionLogic(ctx, s.svcCtx)
|
|
return l.CheckPermission(in)
|
|
}
|
|
|
|
func (s *UsercenterServer) Logout(ctx context.Context, in *pb.LogoutReq) (*pb.LogoutResp, error) {
|
|
l := logic.NewLogoutLogic(ctx, s.svcCtx)
|
|
return l.Logout(in)
|
|
}
|
|
|
|
func (s *UsercenterServer) ResetPassword(ctx context.Context, in *pb.ResetPasswordReq) (*pb.ResetPasswordResp, error) {
|
|
l := logic.NewResetPasswordLogic(ctx, s.svcCtx)
|
|
return l.ResetPassword(in)
|
|
}
|