biz

package
v0.0.0-...-b2f7bc3 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KnowledgeDo

type KnowledgeDo struct {
	Id          int64
	CreatedAt   time.Time
	UpdatedAt   time.Time
	Pid         int64
	Name        string
	ImportLevel string
	Notes       string
}

func (*KnowledgeDo) ConvertToPo

func (k *KnowledgeDo) ConvertToPo(po *KnowledgePo)

type KnowledgePo

type KnowledgePo struct {
	Id          int64
	CreatedAt   time.Time
	UpdatedAt   time.Time
	Pid         int64
	Name        string
	ImportLevel string
	Notes       string
}

func (*KnowledgePo) ConvertToDo

func (k *KnowledgePo) ConvertToDo(do *KnowledgeDo)

func (KnowledgePo) TableName

func (KnowledgePo) TableName() string

type KnowledgeRepoIf

type KnowledgeRepoIf interface {
	Create(ctx context.Context, po KnowledgePo) (*KnowledgePo, error)
	Delete(ctx context.Context, id int64) error
	Update(ctx context.Context, po KnowledgePo) (*KnowledgePo, error)
	Find(ctx context.Context, id int64) (*KnowledgePo, error)
	Count(ctx context.Context, wheres ...func(*gorm.DB) *gorm.DB) (int64, error)
	List(ctx context.Context, order string, wheres ...func(*gorm.DB) *gorm.DB) ([]KnowledgePo, error)
	Page(ctx context.Context, page, pageSize int64, order string, wheres ...func(*gorm.DB) *gorm.DB) (int64, []KnowledgePo, error)

	ScopeKeyWord(keyWord string) func(*gorm.DB) *gorm.DB
	ScopeId(id int64) func(*gorm.DB) *gorm.DB
	ScopePid(pid int64) func(*gorm.DB) *gorm.DB
	ScopeImportLevel(importLevel string) func(*gorm.DB) *gorm.DB
}

KnowledgeRepoIf is a repo.

type KnowledgeUseCase

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

func NewKnowledgeUseCase

func NewKnowledgeUseCase(repo KnowledgeRepoIf, logger log.Logger) *KnowledgeUseCase

func (*KnowledgeUseCase) CreateKnowledge

func (s *KnowledgeUseCase) CreateKnowledge(ctx context.Context, do KnowledgeDo) (*KnowledgeDo, error)

func (*KnowledgeUseCase) DeleteKnowledge

func (s *KnowledgeUseCase) DeleteKnowledge(ctx context.Context, id int64) error

func (*KnowledgeUseCase) GetKnowledge

func (s *KnowledgeUseCase) GetKnowledge(ctx context.Context, id int64) (*KnowledgeDo, error)

func (*KnowledgeUseCase) ListKnowledge

func (s *KnowledgeUseCase) ListKnowledge(ctx context.Context, req *pb.ListKnowledgeRequest) (int64, []KnowledgeDo, error)

func (*KnowledgeUseCase) UpdateKnowledge

func (s *KnowledgeUseCase) UpdateKnowledge(ctx context.Context, do KnowledgeDo) (*KnowledgeDo, error)

type Transaction

type Transaction interface {
	ExecTx(context.Context, func(ctx context.Context) error) error
}

Transaction 新增事务接口方法

Jump to

Keyboard shortcuts

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