Merge branch 'ai/0.4.0/tag' into test

This commit is contained in:
aichy126 2022-11-16 15:36:21 +08:00
commit c9821f80ff
1 changed files with 7 additions and 0 deletions

View File

@ -143,6 +143,13 @@ func (ts *TagCommonService) GetTagListByNames(ctx context.Context, tagNames []st
}
func (ts *TagCommonService) ExistRecommend(ctx context.Context, tags []*schema.TagItem) (bool, error) {
taginfo, err := ts.siteInfoService.GetSiteWrite(ctx)
if err != nil {
return false, err
}
if !taginfo.RequiredTag {
return true, nil
}
tagNames := make([]string, 0)
for _, item := range tags {
tagNames = append(tagNames, item.SlugName)