impl

package
v0.0.0-...-36d29c1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Impl

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

依赖MySQL连接, 能与MySQL交互 负责实现Blog Service

func NewImpl

func NewImpl() *Impl

func (*Impl) CreateBlog

func (i *Impl) CreateBlog(ctx context.Context, req *blog.CreateBlogRequest) (
	*blog.Blog, error)

新建文章

func (*Impl) DB

func (i *Impl) DB() *gorm.DB

func (*Impl) DeleteBlog

func (i *Impl) DeleteBlog(ctx context.Context, req *blog.DeleteBlogRequest) (
	*blog.Blog, error)

文章的删除 为什么删除后,还要返回数据, 方便前端和事件总线使用

func (*Impl) DescribeBlog

func (i *Impl) DescribeBlog(ctx context.Context, req *blog.DescribeBlogRequest) (
	*blog.Blog, error)

文章详情

func (*Impl) Init

func (i *Impl) Init() error

当这个对象初始化的,会获取该对象需要的依赖 需要db这个依赖, 从配置文件中获取

func (*Impl) Name

func (i *Impl) Name() string

func (*Impl) QueryBlog

func (i *Impl) QueryBlog(ctx context.Context, req *blog.QueryBlogRequest) (
	*blog.BlogSet, error)

文章列表

func (*Impl) UpdateBlog

func (i *Impl) UpdateBlog(ctx context.Context, req *blog.UpdateBlogRequest) (
	*blog.Blog, error)

func (*Impl) UpdateBlogStatus

func (i *Impl) UpdateBlogStatus(ctx context.Context, req *blog.UpdateBlogStatusRequest) (
	*blog.Blog, error)

更新文章的状态

Jump to

Keyboard shortcuts

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