Documentation ¶
Index ¶
- type TagCommonRepo
- type TagCommonService
- func (ts *TagCommonService) AddTagList(ctx context.Context, tagList []*entity.Tag) (err error)
- func (ts *TagCommonService) BatchGetObjectTag(ctx context.Context, objectIds []string) (map[string][]*schema.TagResp, error)
- func (ts *TagCommonService) CheckTag(ctx context.Context, tags []string, userID string) (err error)
- func (ts *TagCommonService) CreateOrUpdateTagRelList(ctx context.Context, objectId string, tagIDs []string) (err error)
- func (ts *TagCommonService) ExistRecommend(ctx context.Context, tags []*schema.TagItem) (bool, error)
- func (ts *TagCommonService) GetObjectEntityTag(ctx context.Context, objectId string) (objTags []*entity.Tag, err error)
- func (ts *TagCommonService) GetObjectTag(ctx context.Context, objectId string) (objTags []*schema.TagResp, err error)
- func (ts *TagCommonService) GetSiteWriteRecommendTag(ctx context.Context) (tags []string, err error)
- func (ts *TagCommonService) GetSiteWriteReservedTag(ctx context.Context) (tags []string, err error)
- func (ts *TagCommonService) GetTagByID(ctx context.Context, tagID string) (tag *entity.Tag, exist bool, err error)
- func (ts *TagCommonService) GetTagBySlugName(ctx context.Context, slugName string) (tag *entity.Tag, exist bool, err error)
- func (ts *TagCommonService) GetTagListByIDs(ctx context.Context, ids []string) (tagList []*entity.Tag, err error)
- func (ts *TagCommonService) GetTagListByNames(ctx context.Context, tagNames []string) ([]*entity.Tag, error)
- func (ts *TagCommonService) GetTagPage(ctx context.Context, page, pageSize int, tag *entity.Tag, queryCond string) (tagList []*entity.Tag, total int64, err error)
- func (ts *TagCommonService) ObjectChangeTag(ctx context.Context, objectTagData *schema.TagChange) (err error)
- func (ts *TagCommonService) ObjectCheckChangeTag(ctx context.Context, oldobjectTagData, objectTagData []*entity.Tag) (bool, []string)
- func (ts *TagCommonService) RefreshTagQuestionCount(ctx context.Context, tagIDs []string) (err error)
- func (ts *TagCommonService) SearchTagLike(ctx context.Context, req *schema.SearchTagLikeReq) (resp []schema.SearchTagLikeResp, err error)
- func (ts *TagCommonService) SetSiteWriteTag(ctx context.Context, recommendTags, reservedTags []string, userID string) (errFields []*validator.FormErrorField, err error)
- func (ts *TagCommonService) SetTagsAttribute(ctx context.Context, tags []string, attribute string) (err error)
- func (ts *TagCommonService) TagFormat(ctx context.Context, tags []*entity.Tag) (objTags []*schema.TagResp, err error)
- type TagRelRepo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TagCommonRepo ¶ added in v0.4.0
type TagCommonRepo interface { AddTagList(ctx context.Context, tagList []*entity.Tag) (err error) GetTagListByIDs(ctx context.Context, ids []string) (tagList []*entity.Tag, err error) GetTagBySlugName(ctx context.Context, slugName string) (tagInfo *entity.Tag, exist bool, err error) GetTagListByName(ctx context.Context, name string, limit int, hasReserved bool) (tagList []*entity.Tag, err error) GetTagListByNames(ctx context.Context, names []string) (tagList []*entity.Tag, err error) GetTagByID(ctx context.Context, tagID string) (tag *entity.Tag, exist bool, err error) GetTagPage(ctx context.Context, page, pageSize int, tag *entity.Tag, queryCond string) (tagList []*entity.Tag, total int64, err error) GetRecommendTagList(ctx context.Context) (tagList []*entity.Tag, err error) GetReservedTagList(ctx context.Context) (tagList []*entity.Tag, err error) UpdateTagsAttribute(ctx context.Context, tags []string, attribute string, value bool) (err error) UpdateTagQuestionCount(ctx context.Context, tagID string, questionCount int) (err error) }
type TagCommonService ¶
type TagCommonService struct {
// contains filtered or unexported fields
}
TagCommonService user service
func NewTagCommonService ¶
func NewTagCommonService(tagCommonRepo TagCommonRepo, tagRelRepo TagRelRepo, revisionService *revision_common.RevisionService, siteInfoService *siteinfo_common.SiteInfoCommonService, ) *TagCommonService
NewTagCommonService new tag service
func (*TagCommonService) AddTagList ¶ added in v0.4.0
AddTagList get object tag
func (*TagCommonService) BatchGetObjectTag ¶
func (ts *TagCommonService) BatchGetObjectTag(ctx context.Context, objectIds []string) (map[string][]*schema.TagResp, error)
BatchGetObjectTag batch get object tag
func (*TagCommonService) CreateOrUpdateTagRelList ¶
func (ts *TagCommonService) CreateOrUpdateTagRelList(ctx context.Context, objectId string, tagIDs []string) (err error)
CreateOrUpdateTagRelList if tag relation is exists update status, if not create it
func (*TagCommonService) ExistRecommend ¶ added in v0.4.0
func (*TagCommonService) GetObjectEntityTag ¶ added in v0.4.0
func (*TagCommonService) GetObjectTag ¶
func (ts *TagCommonService) GetObjectTag(ctx context.Context, objectId string) (objTags []*schema.TagResp, err error)
GetObjectTag get object tag
func (*TagCommonService) GetSiteWriteRecommendTag ¶ added in v0.4.0
func (ts *TagCommonService) GetSiteWriteRecommendTag(ctx context.Context) (tags []string, err error)
func (*TagCommonService) GetSiteWriteReservedTag ¶ added in v0.4.0
func (ts *TagCommonService) GetSiteWriteReservedTag(ctx context.Context) (tags []string, err error)
func (*TagCommonService) GetTagByID ¶ added in v0.4.0
func (ts *TagCommonService) GetTagByID(ctx context.Context, tagID string) (tag *entity.Tag, exist bool, err error)
GetTagByID get object tag
func (*TagCommonService) GetTagBySlugName ¶ added in v0.4.0
func (ts *TagCommonService) GetTagBySlugName(ctx context.Context, slugName string) (tag *entity.Tag, exist bool, err error)
GetTagBySlugName get object tag
func (*TagCommonService) GetTagListByIDs ¶ added in v0.4.0
func (ts *TagCommonService) GetTagListByIDs(ctx context.Context, ids []string) (tagList []*entity.Tag, err error)
GetTagListByIDs get object tag
func (*TagCommonService) GetTagListByNames ¶
func (*TagCommonService) GetTagPage ¶ added in v0.4.0
func (ts *TagCommonService) GetTagPage(ctx context.Context, page, pageSize int, tag *entity.Tag, queryCond string) ( tagList []*entity.Tag, total int64, err error)
GetTagPage get object tag
func (*TagCommonService) ObjectChangeTag ¶
func (ts *TagCommonService) ObjectChangeTag(ctx context.Context, objectTagData *schema.TagChange) (err error)
ObjectChangeTag change object tag list
func (*TagCommonService) ObjectCheckChangeTag ¶ added in v0.4.0
func (*TagCommonService) RefreshTagQuestionCount ¶
func (ts *TagCommonService) RefreshTagQuestionCount(ctx context.Context, tagIDs []string) (err error)
RefreshTagQuestionCount refresh tag question count
func (*TagCommonService) SearchTagLike ¶ added in v0.4.0
func (ts *TagCommonService) SearchTagLike(ctx context.Context, req *schema.SearchTagLikeReq) (resp []schema.SearchTagLikeResp, err error)
SearchTagLike get tag list all
func (*TagCommonService) SetSiteWriteTag ¶ added in v0.4.0
func (ts *TagCommonService) SetSiteWriteTag(ctx context.Context, recommendTags, reservedTags []string, userID string) ( errFields []*validator.FormErrorField, err error)
func (*TagCommonService) SetTagsAttribute ¶ added in v0.4.0
func (ts *TagCommonService) SetTagsAttribute(ctx context.Context, tags []string, attribute string) (err error)
SetTagsAttribute
type TagRelRepo ¶
type TagRelRepo interface { AddTagRelList(ctx context.Context, tagList []*entity.TagRel) (err error) RemoveTagRelListByIDs(ctx context.Context, ids []int64) (err error) EnableTagRelByIDs(ctx context.Context, ids []int64) (err error) GetObjectTagRelWithoutStatus(ctx context.Context, objectId, tagID string) (tagRel *entity.TagRel, exist bool, err error) GetObjectTagRelList(ctx context.Context, objectId string) (tagListList []*entity.TagRel, err error) BatchGetObjectTagRelList(ctx context.Context, objectIds []string) (tagListList []*entity.TagRel, err error) CountTagRelByTagID(ctx context.Context, tagID string) (count int64, err error) }
Click to show internal directories.
Click to hide internal directories.