tag_common

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

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, hasReserved 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,
) *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) ObjectChangeTag

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

ObjectChangeTag change object tag list

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

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)
	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)
	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