Documentation ¶
Index ¶
- type KnowledgeDo
- type KnowledgePo
- type KnowledgeRepoIf
- type KnowledgeUseCase
- func (s *KnowledgeUseCase) CreateKnowledge(ctx context.Context, do KnowledgeDo) (*KnowledgeDo, error)
- func (s *KnowledgeUseCase) DeleteKnowledge(ctx context.Context, id int64) error
- func (s *KnowledgeUseCase) GetKnowledge(ctx context.Context, id int64) (*KnowledgeDo, error)
- func (s *KnowledgeUseCase) ListKnowledge(ctx context.Context, req *pb.ListKnowledgeRequest) (int64, []KnowledgeDo, error)
- func (s *KnowledgeUseCase) UpdateKnowledge(ctx context.Context, do KnowledgeDo) (*KnowledgeDo, error)
- type Transaction
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)
Click to show internal directories.
Click to hide internal directories.