Skip to content

Commit 29ec29b

Browse files
committed
feat(menu): update admin menu settings to include questions, tags, and advanced options
1 parent 5be6ec9 commit 29ec29b

16 files changed

Lines changed: 490 additions & 124 deletions

File tree

cmd/wire_gen.go

Lines changed: 27 additions & 47 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ require (
3737
github.com/grokify/html-strip-tags-go v0.1.0
3838
github.com/jinzhu/copier v0.4.0
3939
github.com/jinzhu/now v1.1.5
40+
github.com/joho/godotenv v1.5.1
4041
github.com/lib/pq v1.10.9
4142
github.com/microcosm-cc/bluemonday v1.0.27
4243
github.com/mozillazg/go-pinyin v0.20.0
@@ -117,7 +118,6 @@ require (
117118
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
118119
github.com/hashicorp/hcl v1.0.0 // indirect
119120
github.com/inconshreveable/mousetrap v1.1.0 // indirect
120-
github.com/joho/godotenv v1.5.1 // indirect
121121
github.com/josharian/intern v1.0.0 // indirect
122122
github.com/json-iterator/go v1.1.12 // indirect
123123
github.com/klauspost/cpuid/v2 v2.2.8 // indirect

internal/base/constant/site_type.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,7 @@ const (
3131
SiteTypeTheme = "theme"
3232
SiteTypePrivileges = "privileges"
3333
SiteTypeUsers = "users"
34+
SiteTypeAdvanced = "advanced"
35+
SiteTypeQuestions = "questions"
36+
SiteTypeTags = "tags"
3437
)

internal/controller/answer_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ func (ac *AnswerController) AddAnswer(ctx *gin.Context) {
242242
return
243243
}
244244

245-
write, err := ac.siteInfoCommonService.GetSiteWrite(ctx)
245+
write, err := ac.siteInfoCommonService.GetSiteQuestion(ctx)
246246
if err != nil {
247247
handler.HandleResponse(ctx, err, nil)
248248
return

internal/controller/siteinfo_controller.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,15 @@ func (sc *SiteInfoController) GetSiteInfo(ctx *gin.Context) {
8787
if err != nil {
8888
log.Error(err)
8989
}
90-
resp.Write, err = sc.siteInfoService.GetSiteWrite(ctx)
90+
resp.Questions, err = sc.siteInfoService.GetSiteQuestion(ctx)
91+
if err != nil {
92+
log.Error(err)
93+
}
94+
resp.Tags, err = sc.siteInfoService.GetSiteTag(ctx)
95+
if err != nil {
96+
log.Error(err)
97+
}
98+
resp.Advanced, err = sc.siteInfoService.GetSiteAdvanced(ctx)
9199
if err != nil {
92100
log.Error(err)
93101
}

0 commit comments

Comments
 (0)