tag_common

package
v1.6.0-RC1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2025 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

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

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

AddTag get object tag

func (*TagCommonService) AddTagList

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

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

func (*TagCommonService) CheckTag

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

func (*TagCommonService) CheckTagsIsChange

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

CheckTagsIsChange

func (*TagCommonService) CountTagRelByTagID

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

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

func (*TagCommonService) GetObjectEntityTag

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

func (ts *TagCommonService) GetSiteWriteRecommendTag(ctx context.Context) (tags []*schema.SiteWriteTag, err error)

func (*TagCommonService) GetSiteWriteReservedTag

func (ts *TagCommonService) GetSiteWriteReservedTag(ctx context.Context) (tags []*schema.SiteWriteTag, err error)

func (*TagCommonService) GetTagByID

func (ts *TagCommonService) GetTagByID(ctx context.Context, tagID string) (tag *entity.Tag, exist bool, err error)

GetTagByID get object tag

func (*TagCommonService) GetTagBySlugName

func (ts *TagCommonService) GetTagBySlugName(ctx context.Context, slugName string) (tag *entity.Tag, exist bool, err error)

GetTagBySlugName get object tag

func (*TagCommonService) GetTagIDsByMainTagID

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

GetTagIDsByMainTagID get object tag

func (*TagCommonService) GetTagListByIDs

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

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

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

func (*TagCommonService) HideTagRelListByObjectID

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

func (*TagCommonService) MigrateTagQuestions added in v1.5.0

func (ts *TagCommonService) MigrateTagQuestions(ctx context.Context, sourceTagID, targetTagID string) (err error)

MigrateTagQuestions migrate tag question

func (*TagCommonService) ObjectChangeTag

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

ObjectChangeTag change object tag list

func (*TagCommonService) RecoverTagRelListByObjectID

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

RecoverTagRelListByObjectID recover tag relation by object id

func (*TagCommonService) RefreshTagCountByQuestionID

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

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

RemoveTagRelListByObjectID remove tag relation by object id

func (*TagCommonService) SearchTagLike

func (ts *TagCommonService) SearchTagLike(ctx context.Context, req *schema.SearchTagLikeReq) (resp []schema.GetTagBasicResp, err error)

SearchTagLike get tag list all

func (*TagCommonService) SetSiteWriteTag

func (ts *TagCommonService) SetSiteWriteTag(ctx context.Context, recommendTags, reservedTags []string, userID string) (
	errFields []*validator.FormErrorField, err error)

func (*TagCommonService) SetTagsAttribute

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

SetTagsAttribute

func (*TagCommonService) ShowTagRelListByObjectID

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

func (*TagCommonService) TagFormat

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

func (*TagCommonService) TagsFormatRecommendAndReserved

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

func (*TagCommonService) UpdateTag

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, hide bool) (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)
	GetTagRelDefaultStatusByObjectID(ctx context.Context, objectID string) (status int, err error)
	MigrateTagObjects(ctx context.Context, sourceTagId, targetTagId string) 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)
	GetIDsByMainTagId(ctx context.Context, mainTagID string) (tagIDs []string, 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