service

package
v0.0.0-...-27909f7 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: MIT Imports: 17 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

func NewUserService

func NewUserService(repo repository.UserRepo) *userService

NewUserService create a service

Types

type UserService

type UserService interface {
	Login(ctx context.Context, username, password string) (string, error)
	Register(ctx context.Context, username, password string) (string, error)
}

UserService define a interface

type UserServiceServer

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

func NewUserServiceServer

func NewUserServiceServer(repo repository.UserRepo) *UserServiceServer

func (*UserServiceServer) BatchGetUsers

func (*UserServiceServer) CreateUser

func (*UserServiceServer) GetUser

func (*UserServiceServer) Login

func (*UserServiceServer) Logout

func (*UserServiceServer) Register

func (*UserServiceServer) UpdatePassword

func (*UserServiceServer) UpdateUser

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳