service

package
v0.0.0-...-df9b5f9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 19 Imported by: 0

README

Service

业务逻辑层说明

当业务逻辑较多并且复杂时可以在 service 目录下划分二级目录,例如:

  • service/order
  • service/payment

文件说明

为了加以区分,httpservice 的实现方式和 grpcserver 实现方式根据文件后缀进行区分

  • _svc.go 结尾的为 http 服务的 service 实现
  • _grpc_svc.go 结尾的为 grpcserver 实现

Documentation

Index

Constants

This section is empty.

Variables

ServiceSet is service providers.

Functions

This section is empty.

Types

type UserService

type UserService struct {
	// contains filtered or unexported fields
}

UserService 用户业务服务

func NewUserService

func NewUserService(repo repository.UserRepo) *UserService

NewUserService 创建用户业务服务

func (*UserService) BatchGetUsers

BatchGetUsers 批量获取用户

func (*UserService) CreateUser

CreateUser 创建用户

func (*UserService) GetUser

GetUser 获取用户

func (*UserService) Login

func (s *UserService) Login(ctx context.Context, input types.LoginInput) (*types.LoginOutput, error)

Login 用户登录

func (*UserService) Logout

func (s *UserService) Logout(ctx context.Context, input types.LogoutInput) (*types.LogoutOutput, error)

Logout 用户登出

func (*UserService) Register

Register 用户注册

func (*UserService) UpdatePassword

UpdatePassword 更新密码

func (*UserService) UpdateUser

UpdateUser 更新用户

type UserServiceServer

type UserServiceServer struct {
	pb.UnimplementedUserServiceServer
	// contains filtered or unexported fields
}

UserServiceServer gRPC 服务端

func NewUserServiceServer

func NewUserServiceServer(repo repository.UserRepo) *UserServiceServer

NewUserServiceServer 创建 gRPC 服务端

func (*UserServiceServer) BatchGetUsers

BatchGetUsers 批量获取用户

func (*UserServiceServer) CreateUser

CreateUser 创建用户

func (*UserServiceServer) GetUser

GetUser 获取用户

func (*UserServiceServer) Login

Login 登录

func (*UserServiceServer) Logout

Logout 登出

func (*UserServiceServer) Register

Register 注册

func (*UserServiceServer) UpdatePassword

UpdatePassword 更新密码

func (*UserServiceServer) UpdateUser

UpdateUser 更新用户

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL