biz

package
v0.0.0-...-49bf833 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 6 Imported by: 0

README

biz layer

  • 业务逻辑层
  • business logic layer

开发流程

  • biz.go 中存放需要在 biz 层实现的模块
    • user.go 是 user 模块在 biz 层实现具体方法
    • post.go 是 post 模块在 biz 层实现具体方法
  • 在构造 model.UserM 时, 使用 copier 简化代码量
  • CreateUserRequest 结构体的定义文件 user.go 放置在 pkg/api/dazBlog/v1 目录下
    • CreateUserRequest 对用户暴露, 作为 POST /v1/users 接口的请求 Body,将其放置在 pkg
    • 其是专门用来做请求参数的结构体,所以将其放至 pkg/api
    • 考虑后续新加服务,将其放至 pkg/api/dazBlog
    • 考虑 API 版本更新,将其放至 pkg/api/dazBlog/v1

Documentation

Overview

Package biz defines the business logic of the application business logic layer

Package biz is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IBiz

type IBiz interface {
	Users() user.UserBiz
	Posts() post.PostBiz
	AIs() ai.AIBiz
}

IBiz defines the method need to be implemented by the Biz layer

func NewBiz

func NewBiz(ds store.IStore) IBiz

NewBiz create an instance of type IBiz

type MockIBiz

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

MockIBiz is a mock of IBiz interface.

func NewMockIBiz

func NewMockIBiz(ctrl *gomock.Controller) *MockIBiz

NewMockIBiz creates a new mock instance.

func (*MockIBiz) AIs

func (m *MockIBiz) AIs() ai.AIBiz

AIs mocks base method.

func (*MockIBiz) EXPECT

func (m *MockIBiz) EXPECT() *MockIBizMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockIBiz) Posts

func (m *MockIBiz) Posts() post.PostBiz

Posts mocks base method.

func (*MockIBiz) Users

func (m *MockIBiz) Users() user.UserBiz

Users mocks base method.

type MockIBizMockRecorder

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

MockIBizMockRecorder is the mock recorder for MockIBiz.

func (*MockIBizMockRecorder) AIs

func (mr *MockIBizMockRecorder) AIs() *gomock.Call

AIs indicates an expected call of AIs.

func (*MockIBizMockRecorder) Posts

func (mr *MockIBizMockRecorder) Posts() *gomock.Call

Posts indicates an expected call of Posts.

func (*MockIBizMockRecorder) Users

func (mr *MockIBizMockRecorder) Users() *gomock.Call

Users indicates an expected call of Users.

Directories

Path Synopsis
Package ai is a generated GoMock package.
Package ai is a generated GoMock package.
Package post is a generated GoMock package.
Package post is a generated GoMock package.
Package user is a generated GoMock package.
Package user is a generated GoMock package.

Jump to

Keyboard shortcuts

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