Documentation
¶
Index ¶
Constants ¶
View Source
const (
AppName = "tag"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddTagRequest ¶
type AddTagRequest struct { // 一次可以添加多个Tag Tags []*CreateTagRequest }
func NewAddTagRequest ¶
func NewAddTagRequest() *AddTagRequest
func (*AddTagRequest) AddTag ¶
func (req *AddTagRequest) AddTag(tag *CreateTagRequest)
func (*AddTagRequest) BlogIds ¶
func (req *AddTagRequest) BlogIds() (ids []int)
func (*AddTagRequest) Validate ¶
func (req *AddTagRequest) Validate() error
type CreateTagRequest ¶
type QueryTagRequest ¶
func NewQueryTagRequest ¶
func NewQueryTagRequest() *QueryTagRequest
func (*QueryTagRequest) AddTagId ¶
func (req *QueryTagRequest) AddTagId(ids ...int)
type RemoveTagRequest ¶
type RemoveTagRequest struct {
TagIds []int `json:"tag_ids"`
}
func NewRemoveTagRequest ¶
func NewRemoveTagRequest() *RemoveTagRequest
func (*RemoveTagRequest) AddTagId ¶
func (req *RemoveTagRequest) AddTagId(id int)
type Service ¶
type Service interface { // 查询标签 QueryTag(context.Context, *QueryTagRequest) (*TagSet, error) // 文章添加Tag AddTag(context.Context, *AddTagRequest) (*TagSet, error) // 文章移除Tag RemoveTag(context.Context, *RemoveTagRequest) (*TagSet, error) }
type Tag ¶
type Tag struct { // 标签Id Id int `json:"id"` // 创建时间: 用于排序 CreateAt int64 `json:"create_at"` // Tag的具体数据 *CreateTagRequest }
用于存储文章标签, 整个key, value组成一个tag
func NewTagFromAddTagRequest ¶
func NewTagFromAddTagRequest(req *CreateTagRequest) *Tag
type TagSet ¶
type TagSet struct {
Items []*Tag `json:"items"`
}
func NewTagSetFromAddTagRequest ¶
func NewTagSetFromAddTagRequest(req *AddTagRequest) *TagSet
Click to show internal directories.
Click to hide internal directories.