biz

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type UserHandler added in v1.0.6

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

UserHandler 业务逻辑处理器 - 通过依赖注入获取Repository

func (*UserHandler) Create added in v1.0.6

func (*UserHandler) Delete added in v1.0.6

func (h *UserHandler) Delete(ctx context.Context, id int64) error

func (*UserHandler) GetByID added in v1.0.6

func (h *UserHandler) GetByID(ctx context.Context, id int64) (param.UserData, error)

func (*UserHandler) ListUsers added in v1.0.6

func (*UserHandler) Update added in v1.0.6

func (h *UserHandler) Update(ctx context.Context, id int64, req param.UserUpdateRequest) error

type UserRepository added in v1.0.6

type UserRepository interface {

	// ListUsers 查询User列表
	ListUsers(ctx context.Context, req param.UserListUsersRequest) ([]param.UserListItem, int64, error)

	// Create 查询User详情
	Create(ctx context.Context, req param.UserCreateRequest) error

	// GetByID 查询User详情
	GetByID(ctx context.Context, id int64) (param.UserData, error)

	// Update 查询User详情
	Update(ctx context.Context, id int64, req param.UserUpdateRequest) error

	// Delete 执行User操作
	Delete(ctx context.Context, id int64) error
}

UserRepository 数据访问接口 - 符合依赖注入原则

type UserUseCase added in v1.0.6

type UserUseCase interface {
	// ListUsers 获取用户列表
	ListUsers(ctx context.Context, req param.UserListUsersRequest) ([]param.UserListItem, int64, error)

	// Create 创建用户
	Create(ctx context.Context, req param.UserCreateRequest) error

	// GetByID 获取用户详情
	GetByID(ctx context.Context, id int64) (param.UserData, error)

	// Update 更新用户
	Update(ctx context.Context, id int64, req param.UserUpdateRequest) error

	// Delete 删除用户
	Delete(ctx context.Context, id int64) error
}

UserUseCase 业务逻辑接口

func NewUserHandler added in v1.0.6

func NewUserHandler(repo UserRepository) UserUseCase

NewUserHandler 创建业务逻辑处理器 - 符合依赖注入原则

Jump to

Keyboard shortcuts

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