domain

package
v0.0.0-...-6d66e07 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Content

type Content struct {
	ID        int32
	Content   string
	CreatedAt time.Time
	UpdatedAt time.Time
}

type ContentRepo

type ContentRepo interface {
	// db
	GetContent(ctx context.Context, id int32) (*Content, error)
	CreateContent(ctx context.Context, content *Content) (int32, error)
	UpdateContent(ctx context.Context, id int32, content *Content) error
}

Content Repository Content 持久化层接口定义

type ContentUsecase

type ContentUsecase interface {
	Get(ctx context.Context, id int32) (*Content, error)
	Create(ctx context.Context, content *Content) (int32, error)
	Update(ctx context.Context, id int32, content *Content) error
}

Content Usecase Content 业务逻辑层接口定义

type Index

type Index struct {
	ID        int32
	ContentID int32
	Title     string
	Desc      string
	View      int32
	Attr      int32
	CreatedAt time.Time
	UpdatedAt time.Time
	State     int8
}

type IndexRepo

type IndexRepo interface {
	// db
	ListIndex(ctx context.Context, page, pageSize int) ([]*Index, error)
	CreateIndex(ctx context.Context, index *Index) error
	UpdateIndex(ctx context.Context, id int32, index *Index) (int32, error)
	DeleteIndex(ctx context.Context, id int32) error
}

Index Repository

type IndexUsecase

type IndexUsecase interface {
	List(ctx context.Context, page, pageSize int) ([]*Index, error)
	Create(ctx context.Context, index *Index) error
	Update(ctx context.Context, id int32, index *Index) (int32, error)
	Delete(ctx context.Context, id int32) error
}

Index Usecase

Jump to

Keyboard shortcuts

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