go17/vblog/apps/blog/interface.go
2024-12-01 17:17:51 +08:00

56 lines
1.3 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package blog
import (
"context"
"gitlab.com/go-course-project/go17/vblog/utils"
)
type Service interface {
// 创建博客
CreateBlog(context.Context, *CreateBlogRequest) (*Blog, error)
// 博客列表查询
QueryBlog(context.Context, *QueryBlogRequest) (*BlogSet, error)
// 博客详情查询
DescribeBlog(context.Context, *DescribeBlogRequest) (*Blog, error)
// 博客编辑
UpdateBlog(context.Context, *UpdateBlogRequest) (*Blog, error)
// 发布
PublishBlog(context.Context, *PublishBlogRequest) (*Blog, error)
// 删除
DeleteBlog(context.Context, *DeleteBlogRequest) error
}
type DeleteBlogRequest struct {
utils.GetRequest
}
type PublishBlogRequest struct {
utils.GetRequest
StatusSpec
}
type UpdateBlogRequest struct {
utils.GetRequest
CreateBlogRequest
}
type DescribeBlogRequest struct {
utils.GetRequest
}
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"`
}