Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

doc: regenerate swagger doc

LinkinStar697a98951f2b
diff --git a/cmd/answer/wire_gen.go b/cmd/answer/wire_gen.go
index 3ca98751..bf3c483c 100644
--- a/cmd/answer/wire_gen.go
+++ b/cmd/answer/wire_gen.go
@@ -34,6 +34,7 @@ import (
"github.com/answerdev/answer/internal/repo/search_common"
"github.com/answerdev/answer/internal/repo/site_info"
"github.com/answerdev/answer/internal/repo/tag"
+ "github.com/answerdev/answer/internal/repo/tag_common"
"github.com/answerdev/answer/internal/repo/unique"
"github.com/answerdev/answer/internal/repo/user"
"github.com/answerdev/answer/internal/router"
@@ -63,7 +64,7 @@ import (
"github.com/answerdev/answer/internal/service/siteinfo"
"github.com/answerdev/answer/internal/service/siteinfo_common"
tag2 "github.com/answerdev/answer/internal/service/tag"
- "github.com/answerdev/answer/internal/service/tag_common"
+ tag_common2 "github.com/answerdev/answer/internal/service/tag_common"
"github.com/answerdev/answer/internal/service/uploader"
"github.com/answerdev/answer/internal/service/user_backyard"
"github.com/answerdev/answer/internal/service/user_common"
@@ -116,8 +117,8 @@ func initApplication(debug bool, serverConf *conf.Server, dbConf *data.Database,
userCommon := usercommon.NewUserCommon(userRepo)
answerRepo := answer.NewAnswerRepo(dataData, uniqueIDRepo, userRankRepo, activityRepo)
questionRepo := question.NewQuestionRepo(dataData, uniqueIDRepo)
- tagRepo := tag.NewTagRepo(dataData, uniqueIDRepo, siteInfoCommonService)
- objService := object_info.NewObjService(answerRepo, questionRepo, commentCommonRepo, tagRepo)
+ tagCommonRepo := tag_common.NewTagCommonRepo(dataData, uniqueIDRepo)
+ objService := object_info.NewObjService(answerRepo, questionRepo, commentCommonRepo, tagCommonRepo)
voteRepo := activity_common.NewVoteRepo(dataData, activityRepo)
commentService := comment2.NewCommentService(commentRepo, commentCommonRepo, userCommon, objService, voteRepo)
rankService := rank2.NewRankService(userCommon, userRankRepo, objService, configRepo)
@@ -128,18 +129,19 @@ func initApplication(debug bool, serverConf *conf.Server, dbConf *data.Database,
serviceVoteRepo := activity.NewVoteRepo(dataData, uniqueIDRepo, configRepo, activityRepo, userRankRepo, voteRepo)
voteService := service.NewVoteService(serviceVoteRepo, uniqueIDRepo, configRepo, questionRepo, answerRepo, commentCommonRepo, objService)
voteController := controller.NewVoteController(voteService)
+ tagRepo := tag.NewTagRepo(dataData, uniqueIDRepo)
+ tagRelRepo := tag.NewTagRelRepo(dataData)
revisionRepo := revision.NewRevisionRepo(dataData, uniqueIDRepo)
revisionService := revision_common.NewRevisionService(revisionRepo, userRepo)
+ tagCommonService := tag_common2.NewTagCommonService(tagCommonRepo, tagRelRepo, revisionService, siteInfoCommonService)
followRepo := activity_common.NewFollowRepo(dataData, uniqueIDRepo, activityRepo)
- tagService := tag2.NewTagService(tagRepo, revisionService, followRepo, siteInfoCommonService)
+ tagService := tag2.NewTagService(tagRepo, tagCommonService, revisionService, followRepo, siteInfoCommonService)
tagController := controller.NewTagController(tagService, rankService)
followFollowRepo := activity.NewFollowRepo(dataData, uniqueIDRepo, activityRepo)
- followService := follow.NewFollowService(followFollowRepo, followRepo, tagRepo)
+ followService := follow.NewFollowService(followFollowRepo, followRepo, tagCommonRepo)
followController := controller.NewFollowController(followService)
collectionRepo := collection.NewCollectionRepo(dataData, uniqueIDRepo)
collectionGroupRepo := collection.NewCollectionGroupRepo(dataData)
- tagRelRepo := tag.NewTagRelRepo(dataData)
- tagCommonService := tagcommon.NewTagCommonService(tagRepo, tagRelRepo, revisionService, siteInfoCommonService)
collectionCommon := collectioncommon.NewCollectionCommon(collectionRepo)
answerCommon := answercommon.NewAnswerCommon(answerRepo)
metaRepo := meta.NewMetaRepo(dataData)
@@ -155,7 +157,7 @@ func initApplication(debug bool, serverConf *conf.Server, dbConf *data.Database,
answerService := service.NewAnswerService(answerRepo, questionRepo, questionCommon, userCommon, collectionCommon, userRepo, revisionService, answerActivityService, answerCommon, voteRepo)
dashboardService := dashboard.NewDashboardService(questionRepo, answerRepo, commentCommonRepo, voteRepo, userRepo, reportRepo, configRepo, siteInfoCommonService, serviceConf, dataData)
answerController := controller.NewAnswerController(answerService, rankService, dashboardService)
- searchParser := search_parser.NewSearchParser(tagRepo, userCommon)
+ searchParser := search_parser.NewSearchParser(tagCommonService, userCommon)
searchRepo := search_common.NewSearchRepo(dataData, uniqueIDRepo, userCommon)
searchService := service.NewSearchService(searchParser, searchRepo)
searchController := controller.NewSearchController(searchService)
diff --git a/docs/docs.go b/docs/docs.go
index 316bb89e..18be2dd5 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -5256,12 +5256,6 @@ const docTemplate = `{
"description": "if main tag slug name is not empty, this tag is synonymous with the main tag",
"type": "string"
},
- "recommend": {
- "type": "boolean"
- },
- "reserved": {
- "type": "boolean"
- },
"slug_name": {
"description": "slug name",
"type": "string"
diff --git a/docs/swagger.json b/docs/swagger.json
index 25d181d7..e8d96d62 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -5244,12 +5244,6 @@
"description": "if main tag slug name is not empty, this tag is synonymous with the main tag",
"type": "string"
},
- "recommend": {
- "type": "boolean"
- },
- "reserved": {
- "type": "boolean"
- },
"slug_name": {
"description": "slug name",
"type": "string"
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index d0a9d553..0cdd69bf 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -657,10 +657,6 @@ definitions:
description: if main tag slug name is not empty, this tag is synonymous with
the main tag
type: string
- recommend:
- type: boolean
- reserved:
- type: boolean
slug_name:
description: slug name
type: string
diff --git a/internal/service/search_parser/search_parser.go b/internal/service/search_parser/search_parser.go
index bf8ee04e..3fbbba56 100644
--- a/internal/service/search_parser/search_parser.go
+++ b/internal/service/search_parser/search_parser.go
@@ -2,23 +2,24 @@ package search_parser
import (
"context"
+ "regexp"
+ "strings"
+
"github.com/answerdev/answer/internal/schema"
- tagcommon "github.com/answerdev/answer/internal/service/tag_common"
+ "github.com/answerdev/answer/internal/service/tag_common"
usercommon "github.com/answerdev/answer/internal/service/user_common"
"github.com/answerdev/answer/pkg/converter"
- "regexp"
- "strings"
)
type SearchParser struct {
- tagRepo tagcommon.TagRepo
- userCommon *usercommon.UserCommon
+ tagCommonService *tag_common.TagCommonService
+ userCommon *usercommon.UserCommon
}
-func NewSearchParser(tagRepo tagcommon.TagRepo, userCommon *usercommon.UserCommon) *SearchParser {
+func NewSearchParser(tagCommonService *tag_common.TagCommonService, userCommon *usercommon.UserCommon) *SearchParser {
return &SearchParser{
- tagRepo: tagRepo,
- userCommon: userCommon,
+ tagCommonService: tagCommonService,
+ userCommon: userCommon,
}
}
@@ -161,7 +162,7 @@ func (sp *SearchParser) parseTags(query *string) (tags []string) {
}
tags = make([]string, len(res))
for i, item := range res {
- tag, exists, err := sp.tagRepo.GetTagBySlugName(context.TODO(), item[1])
+ tag, exists, err := sp.tagCommonService.GetTagBySlugName(context.TODO(), item[1])
if err != nil || !exists {
continue
}