biz

package
v0.0.0-...-2172325 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Article

type Article struct {
	CategoryId, UserId        int
	ArticleId, Title, Content string
	Category                  *Category
	UpdateTime                *timestamppb.Timestamp
	Tags                      *Tags
	Attributes                *Attributes
}

type ArticleRepo

type ArticleRepo interface {
	ListArticles(ctx context.Context, parent string) (*Articles, error)
	GetArticle(ctx context.Context, name string) (*Article, error)
	SearchArticles(ctx context.Context, name string) (*Articles, error)
	CreateArticle(ctx context.Context, article *Article) (*Article, error)
	UpdateArticle(ctx context.Context, article *Article) (*Article, error)
	DeleteArticle(ctx context.Context, name string) (*emptypb.Empty, error)
}

type ArticleUsecase

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

func NewArticleUsecase

func NewArticleUsecase(repo ArticleRepo, logger log.Logger) *ArticleUsecase

func (*ArticleUsecase) CreateArticle

func (au *ArticleUsecase) CreateArticle(ctx context.Context, article *Article) (*Article, error)

func (*ArticleUsecase) DeleteArticle

func (au *ArticleUsecase) DeleteArticle(ctx context.Context, name string) (*emptypb.Empty, error)

func (*ArticleUsecase) GetArticle

func (au *ArticleUsecase) GetArticle(ctx context.Context, name string) (*Article, error)

func (*ArticleUsecase) ListArticles

func (au *ArticleUsecase) ListArticles(ctx context.Context, parent string) (*Articles, error)

func (*ArticleUsecase) SearchArticles

func (au *ArticleUsecase) SearchArticles(ctx context.Context, name string) (*Articles, error)

func (*ArticleUsecase) UpdateArticle

func (au *ArticleUsecase) UpdateArticle(ctx context.Context, article *Article) (*Article, error)

type Articles

type Articles struct {
	Collection    []*Article
	NextPageToken string
}

type Attribute

type Attribute struct {
	Id, UserId                   int
	Path, Description, ArticleId string
	UpdateTime                   *timestamppb.Timestamp
}

type AttributeRepo

type AttributeRepo interface {
	ListAttributes(ctx context.Context) (*Attributes, error)
	GetAttribute(ctx context.Context, name string) (*Attribute, error)
	SearchAttributes(ctx context.Context, name string) (*Attributes, error)
	CreateAttribute(ctx context.Context, article *Attribute) (*Attribute, error)
	UpdateAttribute(ctx context.Context, article *Attribute) (*Attribute, error)
	DeleteAttribute(ctx context.Context, name string) (*emptypb.Empty, error)
}

type AttributeUsecase

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

func NewAttributeUsecase

func NewAttributeUsecase(repo AttributeRepo, logger log.Logger) *AttributeUsecase

func (*AttributeUsecase) CreateAttribute

func (au *AttributeUsecase) CreateAttribute(ctx context.Context, article *Attribute) (*Attribute, error)

func (*AttributeUsecase) DeleteAttribute

func (au *AttributeUsecase) DeleteAttribute(ctx context.Context, name string) (*emptypb.Empty, error)

func (*AttributeUsecase) GetAttribute

func (au *AttributeUsecase) GetAttribute(ctx context.Context, name string) (*Attribute, error)

func (*AttributeUsecase) ListAttributes

func (au *AttributeUsecase) ListAttributes(ctx context.Context) (*Attributes, error)

func (*AttributeUsecase) SearchAttributes

func (au *AttributeUsecase) SearchAttributes(ctx context.Context, name string) (*Attributes, error)

func (*AttributeUsecase) UpdateAttribute

func (au *AttributeUsecase) UpdateAttribute(ctx context.Context, article *Attribute) (*Attribute, error)

type Attributes

type Attributes struct {
	Collection    []*Attribute
	NextPageToken string
}

type Categories

type Categories struct {
	Collection    []*Category
	NextPageToken string
}

type Category

type Category struct {
	CategoryId                 int
	CategoryName, CategoryCode string
	UpdateTime                 *timestamppb.Timestamp
}

type CategoryRepo

type CategoryRepo interface {
	ListCategories(ctx context.Context) (*Categories, error)
	GetCategory(ctx context.Context, name string) (*Category, error)
	CreateCategory(ctx context.Context, category *Category) (*Category, error)
	UpdateCategory(ctx context.Context, category *Category) (*Category, error)
	DeleteCategory(ctx context.Context, name string) (*emptypb.Empty, error)
}

type CategoryUsecase

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

func NewCategoryUsecase

func NewCategoryUsecase(repo CategoryRepo, logger *log.Logger) *CategoryUsecase

func (*CategoryUsecase) CreateCategory

func (cu *CategoryUsecase) CreateCategory(ctx context.Context, category *Category) (*Category, error)

func (*CategoryUsecase) DeleteCategory

func (cu *CategoryUsecase) DeleteCategory(ctx context.Context, name string) (*emptypb.Empty, error)

func (*CategoryUsecase) GetCategory

func (cu *CategoryUsecase) GetCategory(ctx context.Context, name string) (*Category, error)

func (*CategoryUsecase) ListCategories

func (cu *CategoryUsecase) ListCategories(ctx context.Context) (*Categories, error)

func (*CategoryUsecase) UpdateCategory

func (cu *CategoryUsecase) UpdateCategory(ctx context.Context, category *Category) (*Category, error)

type Tag

type Tag struct {
	TagId      int
	TagName    string
	UpdateTime *timestamppb.Timestamp
}

type TagRepo

type TagRepo interface {
	ListTags(ctx context.Context) (*Tags, error)
	GetTag(ctx context.Context, name string) (*Tag, error)
	CreateTag(ctx context.Context, tag *Tag) (*Tag, error)
	UpdateTag(ctx context.Context, tag *Tag) (*Tag, error)
	DeleteTag(ctx context.Context, name string) (*emptypb.Empty, error)
}

type TagUsecase

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

func NewTagUsecase

func NewTagUsecase(repo TagRepo, logger *log.Logger) *TagUsecase

func (*TagUsecase) CreateTag

func (tu *TagUsecase) CreateTag(ctx context.Context, tag *Tag) (*Tag, error)

func (*TagUsecase) DeleteTag

func (tu *TagUsecase) DeleteTag(ctx context.Context, name string) (*emptypb.Empty, error)

func (*TagUsecase) GetTag

func (tu *TagUsecase) GetTag(ctx context.Context, name string) (*Tag, error)

func (*TagUsecase) ListTags

func (tu *TagUsecase) ListTags(ctx context.Context) (*Tags, error)

func (*TagUsecase) UpdateTag

func (tu *TagUsecase) UpdateTag(ctx context.Context, tag *Tag) (*Tag, error)

type Tags

type Tags struct {
	Collection    []*Tag
	NextPageToken string
}

Jump to

Keyboard shortcuts

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