service

package
v0.0.0-...-01fa819 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MulanPSL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomerService

type CustomerService interface {
	GetAllCustomers(string) ([]domain.Customer, *errs.AppError)
	GetCustomer(string) (*domain.Customer, *errs.AppError)
}

服务层,定义一个服务层接口

type DefaultCustomerService

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

定义结构体,关联CustomerRepository接口 DefaultCustomerService 默认的客户服务结构体

func NewDefaultCustomerService

func NewDefaultCustomerService(repository domain.CustomerRepository) DefaultCustomerService

辅助函数,作用:创建DefaultCustomerService服务

func (DefaultCustomerService) GetAllCustomers

func (s DefaultCustomerService) GetAllCustomers(status string) ([]domain.Customer, *errs.AppError)

定义结构体的方法,使用s.repo.FindAll()接口的方法 GetAllCustomers 默认的客户服务结构体方法

func (DefaultCustomerService) GetCustomer

func (s DefaultCustomerService) GetCustomer(id string) (*domain.Customer, *errs.AppError)

Jump to

Keyboard shortcuts

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