go17/vblog/apps/blog/interface.go

38 lines
840 B
Go
Raw Normal View History

2024-12-01 11:06:09 +08:00
package blog
2024-12-01 16:05:07 +08:00
import (
"context"
"gitlab.com/go-course-project/go17/vblog/utils"
)
2024-12-01 11:06:09 +08:00
type Service interface {
// 创建博客
2024-12-01 16:05:07 +08:00
CreateBlog(context.Context, *CreateBlogRequest) (*Blog, error)
2024-12-01 11:06:09 +08:00
// 博客列表查询
2024-12-01 16:05:07 +08:00
QueryBlog(context.Context, *QueryBlogRequest) (*BlogSet, error)
2024-12-01 11:06:09 +08:00
// 博客详情查询
DescribeBlog()
// 博客编辑
UpdateBlog()
// 发布
PublishBlog()
// 删除
DeleteBlog()
}
2024-12-01 16:05:07 +08:00
type QueryBlogRequest struct {
// 分页参数
utils.PageRequest
// 文章标题模糊匹配, Golang
Keywords string `json:"keywords"`
// 状态过滤参数, 作者nil, 访客: STAGE_PUBLISHED
Stage *STAGE `json:"stage"`
// 查询某个用户具体的文章: 给作者用的
Username string `json:"username"`
// 分类
Category string `json:"category"`
// 查询Tag相关的文章
Tags map[string]string `json:"tag"`
}