tag_common

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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, recommend, reserved bool) (tagList []*entity.Tag, err error)
	GetTagListByNames(ctx context.Context, names []string) (tagList []*entity.Tag, err error)
	GetTagByID(ctx context.Context, tagID string, includeDeleted bool) (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,
	tagRepo TagRepo,
	revisionService *revision_common.RevisionService,
	siteInfoService siteinfo_common.SiteInfoCommonService,
	activityQueueService activity_queue.ActivityQueueService,
) *TagCommonService

NewTagCommonService new tag service

func (*TagCommonService) AddTag added in v1.0.7

func (ts *TagCommonService) AddTag(ctx context.Context, req *schema.AddTagReq) (resp *schema.AddTagResp, err error)

AddTag get object tag

func (*TagCommonService) AddTagList added in v0.4.0

func (ts *TagCommonService) AddTagList(ctx context.Context, tagList []*entity.Tag) (err error)

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) CheckChangeReservedTag added in v0.5.0

func (ts *TagCommonService) CheckChangeReservedTag(ctx context.Context, oldobjectTagData, objectTagData []*entity.Tag) (bool, bool, []string, []string)

func (*TagCommonService) CheckTag added in v0.4.0

func (ts *TagCommonService) CheckTag(ctx context.Context, tags []string, userID string) (err error)

func (*TagCommonService) CheckTagsIsChange added in v0.5.0

func (ts *TagCommonService) CheckTagsIsChange(ctx context.Context, tagNameList, oldtagNameList []string) bool

CheckTagsIsChange

func (*TagCommonService) CountTagRelByTagID added in v1.0.5

func (ts *TagCommonService) CountTagRelByTagID(ctx context.Context, tagID string) (count int64, err error)

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 (ts *TagCommonService) ExistRecommend(ctx context.Context, tags []*schema.TagItem) (bool, error)

func (*TagCommonService) GetObjectEntityTag added in v0.4.0

func (ts *TagCommonService) GetObjectEntityTag(ctx context.Context, objectId string) (objTags []*entity.Tag, err error)

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 (ts *TagCommonService) GetTagListByNames(ctx context.Context, tagNames []string) ([]*entity.Tag, error)

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) HasNewTag added in v1.1.0

func (ts *TagCommonService) HasNewTag(ctx context.Context, tags []*schema.TagItem) (bool, error)

func (*TagCommonService) HideTagRelListByObjectID added in v1.1.0

func (ts *TagCommonService) HideTagRelListByObjectID(ctx context.Context, objectID string) (err error)

func (*TagCommonService) ObjectChangeTag

func (ts *TagCommonService) ObjectChangeTag(ctx context.Context, objectTagData *schema.TagChange) (err error)

ObjectChangeTag change object tag list

func (*TagCommonService) RecoverTagRelListByObjectID added in v1.2.0

func (ts *TagCommonService) RecoverTagRelListByObjectID(ctx context.Context, objectID string) (err error)

RecoverTagRelListByObjectID recover tag relation by object id

func (*TagCommonService) RefreshTagCountByQuestionID added in v1.1.0

func (ts *TagCommonService) RefreshTagCountByQuestionID(ctx context.Context, questionID string) (err error)

func (*TagCommonService) RefreshTagQuestionCount

func (ts *TagCommonService) RefreshTagQuestionCount(ctx context.Context, tagIDs []string) (err error)

RefreshTagQuestionCount refresh tag question count

func (*TagCommonService) RemoveTagRelListByObjectID added in v1.1.0

func (ts *TagCommonService) RemoveTagRelListByObjectID(ctx context.Context, objectID string) (err error)

RemoveTagRelListByObjectID remove tag relation by object id

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

func (*TagCommonService) ShowTagRelListByObjectID added in v1.1.0

func (ts *TagCommonService) ShowTagRelListByObjectID(ctx context.Context, objectID string) (err error)

func (*TagCommonService) TagFormat added in v0.4.0

func (ts *TagCommonService) TagFormat(ctx context.Context, tags []*entity.Tag) (objTags []*schema.TagResp, err error)

func (*TagCommonService) TagsFormatRecommendAndReserved added in v0.5.0

func (ts *TagCommonService) TagsFormatRecommendAndReserved(ctx context.Context, tagList []*entity.Tag)

func (*TagCommonService) UpdateTag added in v0.5.0

func (ts *TagCommonService) UpdateTag(ctx context.Context, req *schema.UpdateTagReq) (err error)

type TagRelRepo

type TagRelRepo interface {
	AddTagRelList(ctx context.Context, tagList []*entity.TagRel) (err error)
	RemoveTagRelListByObjectID(ctx context.Context, objectID string) (err error)
	RecoverTagRelListByObjectID(ctx context.Context, objectID string) (err error)
	ShowTagRelListByObjectID(ctx context.Context, objectID string) (err error)
	HideTagRelListByObjectID(ctx context.Context, objectID string) (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)
}

type TagRepo

type TagRepo interface {
	RemoveTag(ctx context.Context, tagID string) (err error)
	UpdateTag(ctx context.Context, tag *entity.Tag) (err error)
	RecoverTag(ctx context.Context, tagID string) (err error)
	MustGetTagByNameOrID(ctx context.Context, tagID, slugName string) (tag *entity.Tag, exist bool, err error)
	UpdateTagSynonym(ctx context.Context, tagSlugNameList []string, mainTagID int64, mainTagSlugName string) (err error)
	GetTagSynonymCount(ctx context.Context, tagID string) (count int64, err error)
	GetTagList(ctx context.Context, tag *entity.Tag) (tagList []*entity.Tag, err error)
}

Jump to

Keyboard shortcuts

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